Duke4.net Forums: Shadow monsters - Duke4.net Forums

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Shadow monsters

User is offline   F!re-Fly 

#1

I have a simple question to use palette 4.

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.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #2

I bet the problem is from this:

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.
0

User is offline   F!re-Fly 

#3

Hi Hendricks. Happy to see you again. I will test what you gave me. I will give you an answer. For the private message about my RESPAWN problems, do you have an idea? I'm just afraid of using a bad function
0

User is offline   F!re-Fly 

#4

Code tested, do nothing. Monsters killed, become black again (pal 4). Darkus had already made a similar code like this:

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.
0

User is offline   Zaxtor 

#5

I had same issues.
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
0

User is online   Danukem 

  • Duke Plus Developer

#6

FFS Firefly and Zaxtor, just read the code in the actor and make a few changes. Look at the original code when the trooper dies for example:

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.
2

User is offline   Zaxtor 

#7

I see, I never really studied the rf thing.

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

0

User is offline   Zaxtor 

#8

for the ghost.

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.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #9

This is why I often don't bother responding to PMs like this. Constantly asking for code handouts without gaining a deeper understanding. Expecting totally blind copypasting to magically work then putting no effort into bridging the remaining gap when it doesn't. Not showing signs of "getting it".
2

User is offline   F!re-Fly 

#10

Okay thank you guys. I completely forgot that the value "cstat" could create transparency for a sprite.

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

0

User is offline   F!re-Fly 

#11

I should have posted this thread in the one I did for all my coding problems encountered.
0

User is offline   F!re-Fly 

#12

Thanks also to Zaxtor. I will be able to add this code in GAME.CON, without replacing "state rf"
0

User is offline   F!re-Fly 

#13

This will surely help me to unlock a LIZTROOP that activated the "SUFFERDEAD" action
My new LIZTROOP remain strong when they die after doing this action.
0

User is offline   F!re-Fly 

#14

I think the best would be to add "ifspritepal 4" in the monsters code, followed by the new "state rf" will require that I test.
0

User is offline   F!re-Fly 

#15

Here is the code:

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"
0

User is offline   Hendricks266 

  • Weaponized Autism

  #16

View PostFirefly_Trooper, on 14 January 2019 - 01:54 PM, said:

Here is the code:

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.
0

User is offline   F!re-Fly 

#17

I see ! Transparency will only take effect when the monster is killed.
0

User is offline   F!re-Fly 

#18

Finally, your code works very well.

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

0

User is offline   F!re-Fly 

#19

I noticed that the code to make shadows, does not work on my new monsters. This only works on the basic monsters of the game.
0

User is offline   F!re-Fly 

#20

New code:

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.
0

User is online   Danukem 

  • Duke Plus Developer

#21

After your explosion of different threads you created a while back, you were "under orders" to keep your CON coding discussion in a single thread, the "CON coding problems" thread, which you did for a while. But lately you have been creating more threads like this again (another one is the flying camera one). Please stop doing that and stick to one thread. It's distracting to other forum users to see multiple threads by one person continually being updated just to say that you did or didn't overcome some trivial scripting problem.
0

User is offline   F!re-Fly 

#22

Ok, sorry I do not do it on purpose. I will report the last problems in my basic thread.
1

User is offline   F!re-Fly 

#23

The famous code monsters-shadows, will be improved when I have time.

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

0

User is offline   F!re-Fly 

#24

Codes for monsters with a shadow appearance is improved. However, I have two small mistakes.

//
//
//    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

0

User is offline   Darkus 

#25

View PostFirefly_Trooper, on 08 March 2019 - 08:50 AM, said:

I can not delete "bloodpool" and "bloodsplat" for these special enemies.


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

0

User is offline   F!re-Fly 

#26

I want to remove all the blood and guts for these enemy shadows.
0

User is offline   Darkus 

#27

Another solution is to modify the LIZTROOP actor code directly and change/remove blood and guts when the code tell them to spawn.
0

User is offline   F!re-Fly 

#28

Idea to test. I will see the results.
0

User is offline   F!re-Fly 

#29

Only blood is a problem. The rest works very well.
0

User is offline   F!re-Fly 

#30

Shadow Code working : 98%
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

0

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options