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

Jump to content

Hide message Show message
Welcome to the Duke4.net Forums!

Register an account now to get access to all board features. After you've registered and logged in, you'll be able to create topics, post replies, send and receive private messages, disable the viewing of ads and more!

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Shadow monsters

User is offline   Firefly_Trooper 

  • 15

#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 

  • EDuke32 Senior Developer
  • 6,191

  #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   Firefly_Trooper 

  • 15

#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   Firefly_Trooper 

  • 15

#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 

  • 1,419

#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

Trequonia TC's Status:
Levels : 100% done - Textures : 100% done - Sounds : 100% done - Musics :100% done
Mod is finished, going to test it.
Trequonia's Official website
0

User is online   Trooper Dan 

  • Duke Plus Developer
  • 3,316

#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 

  • 1,419

#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

Trequonia TC's Status:
Levels : 100% done - Textures : 100% done - Sounds : 100% done - Musics :100% done
Mod is finished, going to test it.
Trequonia's Official website

This post has been edited by Zaxtor: 13 January 2019 - 12:02 PM

0

User is offline   Zaxtor 

  • 1,419

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

Trequonia TC's Status:
Levels : 100% done - Textures : 100% done - Sounds : 100% done - Musics :100% done
Mod is finished, going to test it.
Trequonia's Official website
0

User is offline   Hendricks266 

  • EDuke32 Senior Developer
  • 6,191

  #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   Firefly_Trooper 

  • 15

#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   Firefly_Trooper 

  • 15

#11

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

User is offline   Firefly_Trooper 

  • 15

#12

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

User is offline   Firefly_Trooper 

  • 15

#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   Firefly_Trooper 

  • 15

#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   Firefly_Trooper 

  • 15

#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 

  • EDuke32 Senior Developer
  • 6,191

  #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   Firefly_Trooper 

  • 15

#17

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

User is offline   Firefly_Trooper 

  • 15

#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   Firefly_Trooper 

  • 15

#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   Firefly_Trooper 

  • 15

#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   Trooper Dan 

  • Duke Plus Developer
  • 3,316

#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   Firefly_Trooper 

  • 15

#22

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks are property of their respective owners. Instead of reading this text, you could be playing Ion Maiden! ;) © 2018 Voidpoint, LLC

Enter your sign in name and password


Sign in options