
EDuke32 Scripting "CON coding help"
#384 Posted 15 October 2009 - 06:29 AM
#385 Posted 15 October 2009 - 08:28 AM
Here's a link to the fixed build.
Once again, Plagman, thanks!
#386 Posted 17 October 2009 - 06:21 AM
Quote
33317: 31337 {
33318: 1899 getactor 253 19 332 230 332 14
33325: 1901 divvarvar 332
33327: 4 guniqhudid 253 17
33330: 1902 cos 385
33332: 4 guniqhudid 253 15
33335: 1903 sin 386
33337: 4 guniqhudid 253 15
33340: 1904 hitscan
33341: 4 guniqhudid 253 0
33344: 4 guniqhudid 253 1
33347: 4 guniqhudid 253 2
33350: 4 guniqhudid 253 13 385 386 332current actor: 288 (2605)
g_errorLineNum: 0, g_tw: 386
This is the CON part that causes the error:
Quote
mulvar ATEMP 16384
divvarvar ATEMP sprite[THISACTOR].xvel
cos ANGX sprite[THISACTOR].ang
sin ANGY sprite[THISACTOR].ang
hitscan sprite[THISACTOR].x sprite[THISACTOR].y sprite[THISACTOR].z sprite[THISACTOR].sectnum ANGX ANGY ATEMP
RETURN RETURN ATARGET RETURN RETURN RETURN 4294901808
#387 Posted 18 October 2009 - 12:25 PM
#388 Posted 22 October 2009 - 06:54 PM

I'm developing a shield buff [like a status buff] for NR, which is supposed to in theory "block" and sometimes "reflect/deflect" mystic-based attacks [one example can be the Octabrain's/Cycloid's mindblasts. I got it to "block" okay, but I was curious if anyone had ever tried the "deflect" part in their own code runs before.
Basically what I'm hoping to pull off is that when a projectile that can be blocked/deflected hits the shield, the original Projectile copies certain properties to a new projectile of identical strength and stuff but with the player's owner id, and bounce it away from them. For the best effect in my opinion, I need to know if it's possible to make a projectile disappear mid-impact[as in it won't show it's impact/explosion animation and just vanishes instantly]. I'm not sure if it can be done with custom or hard-coded projectiles or not.
I'm going to eventually work at this, but I got other tweaks for earlier stuff to worry about before I do, and I figured on dropping this set of questions on you guys in the meantime.

This post has been edited by Lord Misfit: 22 October 2009 - 06:55 PM
#389 Posted 22 October 2009 - 07:04 PM
#390 Posted 22 October 2009 - 08:46 PM
Lord Misfit, on Oct 22 2009, 07:54 PM, said:
I've made a few player force fields that deflect projectiles. Just change the angle of the projectile, it's zvel and owner. You don't need to fire a new one. You can spawn an animation sprite at the point where it deflects and play a sound. Maybe the real problem is you don't know how to make the projectile deflect without it dying. You can have the projectile detect distance to the force field and hitscan for it, then turn it around before it actually hits anything. Another method is to allow it to hit, but use EVENT_KILLIT to cancel its death and then turn it around from there.
#391 Posted 24 October 2009 - 08:37 AM
I am trying to create a remote controlled missile. But it is unable to kill most monsters unless the player wakes them first.
It also seems that monsters behave differently when asleep. So is it possible to blow up Liz troopers when asleep.
But not possible to blow up Liz mans.
#392 Posted 24 October 2009 - 09:30 AM
DeeperThought, on Oct 23 2009, 12:46 AM, said:
I should let you guys know I have gotten most of this all working now with deflecting stuff. It's not the exact method above, but I do have EVENT_KILLIT involved with a lot of it, and I still let the original projectile die and spawn a new one[but I can destroy the originals instantly too]. The only minor snafu with it is that when it deflect's a COOLEXPLOSION1, I try to get it's count and actorcount just before it's deleted through htg_t 0 & 2, but they always come back as 0 so when the new projectile is spawned, it spawns at it's default animation frames instead of part-way into the animation already.
Because of this I've been considering remaking a "COOLEXPLOSION2" or something as a replacement so deflected mindblasts actually hurt non-players and such, but I'm trying to get an idea of the animation speed and fuse/lifetime of the original COOLEXPLOSION1 is in exact values. Does anyone know that information on this topic? It would be a big help for me.

#393 Posted 24 October 2009 - 09:52 AM
#394 Posted 24 October 2009 - 10:01 AM
Lord Misfit, on Oct 24 2009, 10:30 AM, said:
Because of this I've been considering remaking a "COOLEXPLOSION2" or something as a replacement so deflected mindblasts actually hurt non-players and such, but I'm trying to get an idea of the animation speed and fuse/lifetime of the original COOLEXPLOSION1 is in exact values. Does anyone know that information on this topic? It would be a big help for me.

Why shouldn't the animation reset, and why would anyone care ? I appreciate attention to detail, but this crosses the line into being a weird fetish. You are spending time and adding code to deal with "problems" that no one cares about (and I'm not saying that based only on this feature).
#395 Posted 24 October 2009 - 12:14 PM
case COOLEXPLOSION1__STATIC: t->shade = -127; t->cstat |= 8192; t->picnum += (s->shade>>1); break;
if (s->picnum == COOLEXPLOSION1) { s->shade++; if (s->shade >= 40) KILLIT(i); }
Does that help?
#396 Posted 24 October 2009 - 04:04 PM
#397 Posted 04 November 2009 - 08:15 AM
#398 Posted 04 November 2009 - 10:56 AM
#399 Posted 04 November 2009 - 11:21 AM
XThX2, on Nov 4 2009, 10:56 AM, said:
Hmmm.. I did try something earlier where I coded the arrow to spawn a SHOTSPARK1 on impact, then coded the SHOTSPARK1 to use htg_t if it was spawned by an arrow. This way it'd know whether or not it was hitting a wall, and if it did I had it change it's picnum to the arrow (a different set, like you suggested). It's gotten me a bit closer to what I wanted, but now for some reason the arrow ends up spinning around in place when it spawns (even though I know I gave it the correct frames). Strange stuff...
#400 Posted 04 November 2009 - 11:53 AM
findnearsprite IONPARTICLEBOOM 500 returnvar1 ifvarn returnvar1 -1 { getactor[returnvar1].htg_t 2 temp ifvare temp 0 killit }
Where IONPARTICLEBOOM is a bullet based projectile that spawns an explosion when it hits a wall. Try it this way and see if it works. Of course, you would get the necessary information from it before killing it.
This post has been edited by XThX2: 04 November 2009 - 11:55 AM
#401 Posted 05 November 2009 - 09:54 AM
XThX2, on Nov 4 2009, 11:53 AM, said:
findnearsprite IONPARTICLEBOOM 500 returnvar1 ifvarn returnvar1 -1 { getactor[returnvar1].htg_t 2 temp ifvare temp 0 killit }
Where IONPARTICLEBOOM is a bullet based projectile that spawns an explosion when it hits a wall. Try it this way and see if it works. Of course, you would get the necessary information from it before killing it.
Well, I changed the code from changing picnums to just having it spawn the stuck arrow actor and that got rid of the crazy rotating problem. Last hurdle is trying to figure out how to get it closer to the wall to actually create the illusion that it's really stuck in the wall (right now it spawns a few inches away so, it's just sort of hanging in mid-air). Just to see what would happen, I coded the arrow to move further inwards towards the wall once it spawns then stop after a few tics, but it vanishes if it goes too far, and just hangs in the middle of the wall if it's actually 'within' it. Is this something that only a model can fix?
#402 Posted 05 November 2009 - 10:37 AM

#403 Posted 05 November 2009 - 11:22 AM
XThX2, on Nov 5 2009, 11:37 AM, said:

At this point I should really know what vertically flat means, but if it's aligned with the floor, then no it's not. Also I found another way to do it that's pretty simple (so simple, i can't believe I didn't think of it beforehand ). I just made a bullet-type projectile that had no graphic or extra value, and spawned a custom decal. I then coded the arrow to spawn another invisible custom actor on impact that would shoot said projectile that would leave behind this decal and that decal, once being spawned, would spawn the arrow in the wall. Sort of has a jerry-rigged feel to it, but it works pretty nicely.
#404 Posted 06 November 2009 - 06:10 AM
This post has been edited by Ilovefoxes: 06 November 2009 - 06:11 AM
#405 Posted 06 November 2009 - 06:38 AM
EmericaSkater, on Nov 5 2009, 12:22 PM, said:
Vertically flat means well, open mapster32, put a sprite and press R, the first time you do it; what you see is vertically flat. (Aligned with wall)
Can they be picked up, by the way ?
#406 Posted 06 November 2009 - 07:19 AM
XThX2, on Nov 6 2009, 07:38 AM, said:
Can they be picked up, by the way ?
Picked up AND climbed on. You'll get to see when I nail down a few more changes and post some more videos. (I got the full version of FRAPS just for you

#407 Posted 06 November 2009 - 08:21 AM
Ilovefoxes, on Nov 6 2009, 06:10 AM, said:
It's not supposed to stop for voting, that sounds like a bug.
#408 Posted 09 November 2009 - 10:38 AM
#409 Posted 09 November 2009 - 10:51 AM
XThX2, on Nov 9 2009, 10:38 AM, said:
I don't know of any way to do that. Maybe you could remove their art (or replace it with something invisible), and then draw your own on the left side in the the appropriate event. That would require having access to where the player is in the menu, though, and I'm not sure if that's available.
#410 Posted 09 November 2009 - 10:56 AM
This post has been edited by XThX2: 09 November 2009 - 10:56 AM
#411 Posted 14 November 2009 - 02:55 AM
This post has been edited by XThX2: 14 November 2009 - 03:00 AM
#412 Posted 20 November 2009 - 08:20 AM
#413 Posted 20 November 2009 - 08:34 AM
EmericaSkater, on Nov 20 2009, 08:20 AM, said:
That's because the sprite you see in F7 mode is not the player sprite. It's a member of the tsprite array which is used only for display purposes. To access that array, use EVENT_ANIMATESPRITES. Only sprites with the 16 bit set in their mdflags member will be processed in that event, so do that first:
actor APLAYER MAXPLAYERHEALTH PSTAND 0 0 getactor[THISACTOR].mdflags temp orvar temp 16 setactor[THISACTOR].mdflags temp
Then, since only player tsprites will be processed and you want them to have cstat 0, do this:
onevent EVENT_ANIMATESPRITES settspr[THISACTOR].tsprcstat 0 endevent