EDuke32 Scripting "CON coding help"
#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
#414 Posted 20 November 2009 - 10:19 AM
DeeperThought, on Nov 20 2009, 09:34 AM, said:
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
Works great. I had the feeling the sprite in 3rd person wasn't actually a player sprite since it would never show up without turning over_shoulder_on to 1 (no matter where I had the camera positioned). Tsprites were probably the one thing I never looked that much into . Thanks abunch, DT
#415 Posted 20 November 2009 - 03:58 PM
They use that because otherwise other player would see a transparent player, which they shoudln't.
It's the same as a sprite standing in a colored sector, it has another tspr palette in a normal sprite.
Note: take care to not change the cstat of player shadow using tspr.
#416 Posted 05 December 2009 - 07:36 AM
setvar spriteid 0 setvar minimum 16777216 setvar minid -1 whilevarn spriteid 16384 { getactor[spriteid].picnum picnum switch picnum case LIZTROOP { getactor[spriteid].x mx getactor[spriteid].y my getactor[spriteid].z mz getactor[spriteid].extra extra getactor[THISACTOR].x x getactor[THISACTOR].y y getactor[THISACTOR].z z subvarvar mx x subvarvar my y getangle mang mx my getactor[THISACTOR].ang ang getincangle mang mang ang ifvarg extra 0 ifvarg mang -256 ifvarl mang 256 { dist tmp THISACTOR spriteid ifvarvarl tmp minimum { setvarvar minimum tmp } ifvarvare tmp minimum ifvarvarn spriteid THISACTOR setvarvar minid spriteid } } break endswitch addvar spriteid 1 } ifvarn minid -1 { getactor[minid].x mx getactor[minid].y my getactor[minid].z mz getactor[minid].sectnum sect2 cansee camerax cameray cameraz camerasect mx my mz sect2 see addlogvar see }
In case at picture see variable equal is 0, why?
canseespr isn't works correctly and have more cases when see variable = 0
Help me to fix this problem! please
Attached File(s)
-
duke0000.bmp (769.05K)
Number of downloads: 209
#417 Posted 05 December 2009 - 08:54 AM
M210, on Dec 5 2009, 07:36 AM, said:
Canseespr wasn't working because you didn't raise the sprites up before checking. This is a very common problem and there should be something in the wiki about it (I'll add it to canseespr if it isn't there yet). canseespr determines visibility from the base of the sprites (the bottom of their feet) which is a poor position to see from. You made the same mistake with cansee. Try using subvar mz 8192 right before the cansee command.
#418 Posted 05 December 2009 - 09:35 AM
Screenshot, see = 0
Attached File(s)
-
Untitled_1.bmp (873.8K)
Number of downloads: 212
#419 Posted 05 December 2009 - 10:07 AM
M210, on Dec 5 2009, 09:35 AM, said:
Screenshot, see = 0
The change I suggested is necessary, so if it didn't help it's because some other part of your code is not working (probably that getincangle part). You should test the different components of your code separately. Make sure each component is working correctly before you put them together.
EDIT: I just ready throgh your code for the first time, and it's really weird. Who is THISACTOR? Is that the player? You have some sprite looping through all the sprites in the game, and when it gets to a LIZTROOP it checks whether it is facing it. But if the sprite running the code isn't the player, then there's no reason to believe there should be visibility in the screenshot. But if it is the player, then there is no reason to check ifvarvarn spriteid THISACTOR (since we already know the player isn't a LIZTROOP).
This post has been edited by DeeperThought: 05 December 2009 - 10:21 AM
#420 Posted 05 December 2009 - 10:17 AM
Well, I try to delete getincangle part but it will not helped