I would like to be able to control SEENINE explosions based on their extra value so that I can have alternate explosion types.
onevent EVENT_LOADACTOR
switch sprite[].picnum
case SEENINE // Alternate explosions
{
ifn sprite[].extra -1
geta[].extra extrasaved
}
break
endswitch
endevent
I had then initially put the following under EVENT_SPAWN... however I have moved it to EVENT_EGS;
onevent EVENT_EGS
switch sprite[].picnum
case EXPLOSION2 // Alternate explosions
{
seta[].extra actorvar[sprite[].owner].extrasaved
ife sprite[].extra extrasaved
{
action ASMOKEBLAST1
}
else nullop
}
break
endswitch
endevent
However it's now doing the opposite of what I intended - if I leave the SEENINE with an extra of -1; they spawn ASMOKEBLAST1, and if I give them an extra value they play the default EXPLOSION2... I suspect I do not properly understand the following command;
seta[].extra actorvar[sprite[].owner].extrasaved
Does this assign the saved extra value (extrasaved) from EXPLOSION2's 'owner' SEENINE to EXPLOSION2?
--- I also wanted to know if switch statements can be nested? IE calling a state within a switch statement that also contains a switch statement?