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 !
Page 1 of 1
Unused map icon "Only for the killed player"
#1 Posted 12 October 2019 - 12:00 PM
#2 Posted 12 October 2019 - 02:33 PM
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.
#3 Posted 12 October 2019 - 03:52 PM
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.
#4 Posted 12 October 2019 - 04:22 PM
I think Duke España is dead and will no longer be available.
To draw an image on screen, use rotatesprite. It only works inside screen drawing events.
To draw an image on screen, use rotatesprite. It only works inside screen drawing events.
#5 Posted 12 October 2019 - 05:00 PM
Perro Seco, on 12 October 2019 - 04:22 PM, said:
I think Duke España is dead and will no longer be available.
Duke España archives - Wayback Machine
#6 Posted 13 October 2019 - 04:08 AM
Thank you very much !
The code was like this:
For the second image, I add a new "state" next to the line of code where it dies?
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?
#7 Posted 13 October 2019 - 04:26 AM
I found the lines of code for the image:
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.
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.
#8 Posted 13 October 2019 - 04:42 AM
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.
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
#9 Posted 13 October 2019 - 06:26 AM
Thank you ! The code you gave me works very well like this:
Here ! This little detail is now finished. I will continue coding in my main thread "con coding problems" for other problems to solve.
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.
#10 Posted 13 January 2020 - 08:25 AM
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.
I cannot cancel the display of the "skull" icon when Duke is only shrunk or frozen.
Share this topic:
Page 1 of 1