Duke4.net Forums: Unused map icon - Duke4.net Forums

Jump to content

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

Unused map icon  "Only for the killed player"

User is offline   F!re-Fly 

#1

Good evening! I have a small question, compared to the two unused icons that are supposed to appear on the screen. This is Duke's head when he is alive and when he is dead (represented by a skull). The sprite IDs are 2452 - 2455.

Of course, I was able to easily put Duke's head icon on the screen. Now how to make the other icon appear only when Duke is dead?

I did not find any help on that.

Thank you !
0

User is offline   Kyanos 

#2

Use notepad and read GAME.CON, look for ifpdead it has other useful variables about player state like ifponground or ifphit, anyways use an if condition where you wrote the code that draws the faces with ifpdead to draw the dead face.
0

User is offline   F!re-Fly 

#3

Thanks for the help. Unfortunately, I do not remember how to simply draw a sprite on the screen (it's really stupid of me). The Dukespana forum had a well done tutorial but the site became inaccessible.
0

User is offline   Perro Seco 

#4

I think Duke España is dead and will no longer be available. :o

To draw an image on screen, use rotatesprite. It only works inside screen drawing events.
0

User is offline   Kyanos 

#5

View PostPerro Seco, on 12 October 2019 - 04:22 PM, said:

I think Duke España is dead and will no longer be available. :o

Duke España archives - Wayback Machine
2

User is offline   F!re-Fly 

#6

Thank you very much !

The code was like this:

state newhud
  rotatesprite 25 25 65536 0 2452 0 0 0 0 0 xdim ydim
ends

onevent EVENT_DISPLAYREST
  state newhud
endevent


For the second image, I add a new "state" next to the line of code where it dies?
0

User is offline   F!re-Fly 

#7

I found the lines of code for the image:

ifaction PLYINGDEAD
    {
      ifactioncount 3
        move PSTOPED
      state badguyicon
      quote 13
      ifhitspace
      {
        action PSTAND
        spawn DUKELYINGDEAD
        resetplayer
      }
      break
    }


In this example, Duke normally dies with his corpse. The only problem is that the image appears on the screen, except that it flashes in time and does not stay fixed.
0

User is offline   Kyanos 

#8

I think you will want to put the code in your newhud state, that part you put it in is in the player actions stuff.

I would change state newhud to check if the player is dead there. It's "ifp palive" not ifpdead like I said above.

Something like this.

state newhud
    ifp palive
    {
        rotatesprite 25 25 65536 0 2452 0 0 0 0 0 xdim ydim
    }
    else
    {
        rotatesprite 25 25 65536 0 2453 0 0 0 0 0 xdim ydim
    }
ends

1

User is offline   F!re-Fly 

#9

Thank you ! The code you gave me works very well like this:

state duke_badguy_icon
  ifp palive
  {
    rotatesprite -40 26 65536 0 2452 0 0 0 0 0 xdim ydim
  }
  else
  {
    rotatesprite -15 14 106999 0 2453 0 0 0 0 0 xdim ydim
  }
ends

onevent EVENT_DISPLAYREST
  state duke_badguy_icon
endevent


Here ! This little detail is now finished. I will continue coding in my main thread "con coding problems" for other problems to solve.
0

User is offline   F!re-Fly 

#10

I had defined two icons for the player at the top of the screen, the first when Duke is alive and the second when he is dead.

I cannot cancel the display of the "skull" icon when Duke is only shrunk or frozen.
0

Share this topic:


Page 1 of 1
  • 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