PDA

View Full Version : 2 different explosions problem


jimbob
07-10-2002, 02:34 PM
ok the problem is that when i add an new action in the EDUKE.con defining an second "explosion anim" the explosion doesnt animate it just keeps playing the first frame and doesnt die how can i change tis without overwriting the existing explosion ( if u need the coding i used please say so then i will post it )

Bruce Hamilton
07-10-2002, 04:20 PM
Originally posted by jimbob:
if u need the coding i used please say so...<font size="2" face="Verdana, Arial">Would be a help...

jimbob
07-10-2002, 11:30 PM
action EXPLOSION_FRAMES 0 20 1 1 8
action NUKE_FRAMES 3360 21 1 1 8

actor EXPLOSION2 1 EXPLOSION_FRAMES
cstat 2 { ifspawnedby RPG { cstat 0 spritepal 2 sizeat 200 200
ifp palive ifp pfacing ifpdistl 12500 palfrom 48 48 40 40
{ ifrnd 64 spawn NUKE }
}
}
ifspawnedby TRIPBOMB { cstat 0 sizeat 75 75 }
ifactioncount 20
killit
enda

the nuke works and the tripbomb 2 but the new action doesn`t work it does show the art but gets stuck at the first frame

Usurper
07-11-2002, 12:11 AM
Originally posted by jimbob:
action EXPLOSION_FRAMES 0 20 1 1 8
action NUKE_FRAMES 3360 21 1 1 8

actor EXPLOSION2 1 EXPLOSION_FRAMES
cstat 2 { ifspawnedby RPG { cstat 0 spritepal 2 sizeat 200 200
ifp palive ifp pfacing ifpdistl 12500 palfrom 48 48 40 40
{ ifrnd 64 spawn NUKE }
}
}
ifspawnedby TRIPBOMB { cstat 0 sizeat 75 75 }
ifactioncount 20
killit
enda

the nuke works and the tripbomb 2 but the new action doesn`t work it does show the art but gets stuck at the first frame<font size="2" face="Verdana, Arial">It's been a while. I use too many brackets, but it keeps things neat. Anyway, try this:

action EXPLOSION_FRAMES 0 20 1 1 8
action NUKE_FRAMES 3360 21 1 1 8

actor EXPLOSION2 1 0
ifspawnedby RPG {
action NUKE_FRAMES
cstat 0 spritepal 2 sizeat 200 200 }
ifspawnedby TRIPBOMB { action EXPLOSION_FRAMES cstat 2 sizeat 75 75 }
else { action EXPLOSION_FRAMES cstat 2 }

ifaction NUKE_FRAMES
{
ifp pfacing
{ ifpdistl 12500 palfrom 48 48 40 40
}

ifrnd 64 { spawn NUKE }
ifactioncount 20 { killit }
}

ifaction EXPLOSION_FRAMES
{
ifactioncount 20 { killit }
}

enda

Bruce Hamilton
07-11-2002, 07:09 AM
I usually structure code a little differently... Not that it works better, but slight indentation on the if statements makes it easier to read.
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
action EXPLOSION_FRAMES 0 20 1 1 8
action NUKE_FRAMES 3360 21 1 1 8

actor EXPLOSION2 1 0
ifspawnedby RPG{
action NUKE_FRAMES
cstat 0 spritepal 2 sizeat 200 200}

ifspawnedby TRIPBOMB{
action EXPLOSION_FRAMES cstat 2 sizeat 75 75}
else{
action EXPLOSION_FRAMES cstat 2}

ifaction NUKE_FRAMES{
ifp pfacing{
ifpdistl 12500 palfrom 48 48 40 40}
}

ifrnd 64
spawn NUKE

ifactioncount 20
killit

ifaction EXPLOSION_FRAMES{
ifactioncount 20{
killit}
}

enda[/code]</blockquote><font size="2" face="Verdana, Arial">

jimbob
07-11-2002, 10:47 AM
nope sorry both dont work they compile wel no errors but it still doesnt work same problem as before

Mblackwell
07-11-2002, 08:09 PM
It's obvious, have no initial action, then merely have it only play the action "ifaction 0"

otherwise you are causing it to restart constantly by always calling it.

Usurper
07-11-2002, 10:18 PM
Ja, I figured using 0 for action worked as a placeholder, but it probably should be blank.

jimbob
07-12-2002, 10:28 AM
i think part of the explosion is hardcoded or something cuz it just wont work i tried a million things *sigh*

Usurper
07-13-2002, 09:19 PM
It's certainly not impossible. Lots of us have done it. I just haven't touched con code in 10 months or so. Someone around here should know what I'm doing wrong, aside from the action problem.

jimbob
08-15-2002, 06:33 AM
i fixed it after seeing a con file witch turned the shrinker into a napalm cannon the code should look like this
action EXPLOSION_FRAMES 0 20 1 1 8
action NUKE_FRAMES 3360 21 1 1 8

actor EXPLOSION2 1 EXPLOSION_FRAMES
cstat 2 { ifspawnedby RPG { ifaction EXPLOSION_FRAMES
action NUKE_FRAMES cstat 0 sizeat 200 200
ifp palive ifp pfacing ifpdistl 12500 palfrom 48 48 40 40
{ ifrnd 64 spawn NUKE }
}
}
ifspawnedby TRIPBOMB { cstat 0 sizeat 75 75 }
ifactioncount 20
killit
enda

so the ifaction and action combined can turn it into a different explosion problem solved images/icons/grin.gif thx for all the help