Shadow monsters
#1 Posted 11 January 2019 - 01:21 PM
I'd like to make sure monsters can be shadows to kill.
In Mapster32, I use the "T" key to make a transparency of a sprite.
How can one show that transparency is guarded when he is killed?
When the monster is dead, it becomes all black again, with this palette 4.
Thank you.
#2 Posted 11 January 2019 - 01:58 PM
state rf ifrnd 128 cstat 4 else cstat 0 ends
We need to make this state more robust to preserve the transparency bit while filtering out blocking and hitscan and sometimes flipping the dead body.
gamevar state_rf_temp 0 0 state rf getactor[THISACTOR].cstat state_rf_temp andvar state_rf_temp -258 // (int16_t) ~(1|256) ifrnd 128 xorvar state_rf_temp 4 setactor[THISACTOR].cstat state_rf_temp ends
Let me know if this causes any new problems, such as dead bodies floating in the air -- we may need to filter out more bits than blocking and hitscan.
#3 Posted 12 January 2019 - 12:20 PM
#4 Posted 13 January 2019 - 05:30 AM
state rf_unblock // unblock the sprite, but don't change X flipping ifvarand sprite[THISACTOR].cstat 4 cstat 4 else cstat 0 ends
I did not encounter any other strange problems with what you gave me.
#5 Posted 13 January 2019 - 11:28 AM
well didn't take it seriously in Oblivion when you kill the shadow ghost liztroop, when it dies it becomes norm black (not transparent)
if you put example "ifspritepal 4 { cstat 2 }" in ifdead it wont work. I've tried.
if you probably "cactor to a customized carcasses" that has a cstator / stat xx
it would remain transparent black.
like ifspritepal 4 { cactor LIZTROPPDEAD2 }
or something
#6 Posted 13 January 2019 - 11:49 AM
state troopdying iffloordistl 32 { ifactioncount 5 { cstat 0 iffloordistl 8 sound THUD ifrnd 64 spawn BLOODPOOL state rf strength 0 move TROOPSTOPPED action ATROOPDEAD } break }
As you can see, the transparency has been turned off before state rf, where it says "cstat 0". Hendricks code is still necessary since the vanilla version of state rf would also have turned off transparency, but obviously you have to pay attention to what the cstat was before that.
#7 Posted 13 January 2019 - 12:00 PM
PS
rf code has
state rf
ifrnd 128
cstat 4
else
cstat 0
ends
Is weird they put
ifrnd, cstat , else and cstat 0
This post has been edited by Zaxtor: 13 January 2019 - 12:02 PM
#8 Posted 13 January 2019 - 12:21 PM
I made
state grf
ifrnd 128
cstat 4
else
cstat 2
ends
and it works.
when liz dies or w/e , it brings to the state grf instead of rf
normal rf is for normal lizman / liztroops etc.
#9 Posted 13 January 2019 - 09:34 PM
#10 Posted 14 January 2019 - 11:12 AM
Hendricks! The last MP sent do not concern this thread.
The basic RF state was only used for that?
This post has been edited by Firefly_Trooper: 14 January 2019 - 11:14 AM
#11 Posted 14 January 2019 - 11:20 AM
#12 Posted 14 January 2019 - 11:23 AM
#13 Posted 14 January 2019 - 11:48 AM
My new LIZTROOP remain strong when they die after doing this action.
#14 Posted 14 January 2019 - 12:11 PM
#15 Posted 14 January 2019 - 01:54 PM
state rf_unblock // unblock the sprite, but don't change X flipping ifvarand sprite[THISACTOR].cstat 4 cstat 4 else cstat 0 { ifspritepal 4 cstat 514 break } ends
Transparency will be performed, only if you choose "pal 4"
#16 Posted 14 January 2019 - 02:00 PM
Firefly_Trooper, on 14 January 2019 - 01:54 PM, said:
state rf_unblock // unblock the sprite, but don't change X flipping ifvarand sprite[THISACTOR].cstat 4 cstat 4 else cstat 0 { ifspritepal 4 cstat 514 break } ends
Transparency will be performed, only if you choose "pal 4"
This code is deformed. For someone who has been CON coding for months, the problem should really be obvious at a glance.
#17 Posted 14 January 2019 - 02:29 PM
#18 Posted 14 January 2019 - 02:40 PM
gamevar state_rf_shadow_temp 0 0 state rf_shadow getactor[THISACTOR].cstat state_rf_shadow_temp andvar state_rf_shadow_temp -258 // (int16_t) ~(1|256) ifrnd 128 xorvar state_rf_shadow_temp 4 setactor[THISACTOR].cstat state_rf_shadow_temp ends
This post has been edited by Firefly_Trooper: 14 January 2019 - 02:41 PM
#19 Posted 16 January 2019 - 06:57 AM
#20 Posted 16 January 2019 - 12:17 PM
state shadowcode // shadow monsters code ifspritepal 4 cstat 514 break ends
I tested and I added this code in the base monsters. It works very well without bug.
#21 Posted 16 January 2019 - 12:49 PM
#22 Posted 16 January 2019 - 01:04 PM
#23 Posted 04 February 2019 - 12:29 PM
I wish I could make sure that the shadows are only killed by the explosions, do not generate guts and no bloodshed. I'll also turn off the sounds and create an Assault Captain who teleports, while remaining a shadow.
And make sure the projectiles go through them without touching them.
I would do a state or code with an EVENT.
This post has been edited by Firefly_Trooper: 04 February 2019 - 12:37 PM
#24 Posted 08 March 2019 - 08:50 AM
// // // SHADOW MONSTERS CODE // // onevent EVENT_SPAWN // invincible shadow monsters, even for themselves (except RPG / RADIUSEXPLOSION) { switch sprite[THISACTOR].picnum case LIZTROOP ifspritepal 4 cstat 514 break endswitch } endevent onevent EVENT_EGS // not all bloodsplats for shadow monsters { switch sprite[THISACTOR].picnum case BLOODSPLAT1 case BLOODSPLAT2 case BLOODSPLAT3 case BLOODSPLAT4 ifspawnedby LIZTROOP ifspritepal 4 killit break endswitch } endevent onevent EVENT_GAME // not all jibs for shadow monsters { switch sprite[THISACTOR].picnum case JIBS1 case JIBS2 case JIBS3 case JIBS4 case JIBS5 case JIBS6 case HEADJIB1 case LEGJIB1 case ARMJIB1 case LIZMANHEAD1 case LIZMANLEG1 case LIZMANARM1 ifspawnedby LIZTROOP ifspritepal 4 killit break endswitch } endevent onevent EVENT_SPAWN // not bloodpool for shadow monsters { switch sprite[THISACTOR].picnum case BLOODPOOL ifspawnedby LIZTROOP ifspritepal 4 killit break endswitch } endevent appendevent EVENT_SOUND ife RETURN SQUISHED { ifspritepal 4 ife sprite[].picnum LIZTROOP set RETURN BLANK } endevent
I can not delete "bloodpool" and "bloodsplat" for these special enemies.
I have also created a state "shadowcode" to maintain this shadow appearance, when the enemies die or return to the land of the living (especially the Liztroop).
This post has been edited by Firefly_Trooper: 08 March 2019 - 09:47 AM
#25 Posted 08 March 2019 - 12:53 PM
Firefly_Trooper, on 08 March 2019 - 08:50 AM, said:
Your code tell to check if the BLOODPOOL and BLOODSPLAT sprites are black (pal 4) but according to your video, they are spawned red (pal 2). I think you should verify the palette of the actor which created them by replacing ifspritepal 4 by
getactor[THISACTOR].owner TEMPFIX1 ifvare sprite[TEMPFIX1].pal 4
#26 Posted 08 March 2019 - 12:57 PM
#27 Posted 08 March 2019 - 01:06 PM
#30 Posted 09 March 2019 - 11:06 AM
First monster: LIZTROOP
1. not "state checksquished" (living or already dead) is fixed !
2. not spawn "WATERDRIP" when he agonizes is fixed !
3. All monster sounds (except attacks) are removed.
4. Jetpack sound removed.
5. BLOODSPLATS is fixed ! Use invisible cstat value.
----
Not corrected:
1. Removed the "shade" on the ground.
2. removed LIZARD_BEG sound and BLOODPOOL when he agonizes.
This post has been edited by Firefly_Trooper: 09 March 2019 - 11:07 AM