How to do a death message when the player dies

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
aicd99
Posts: 264
Joined: Mon Oct 10, 2011 11:17 am

How to do a death message when the player dies

Post by aicd99 » Sun Jan 08, 2017 7:07 am

I tried doing a death message in the play set-up entity.
But it's not working why ?

Is their a way to make it work ?

Allanon
Posts: 493
Joined: Mon Aug 29, 2005 8:23 am

Re: How to do a death message when the player dies

Post by Allanon » Sun Jan 08, 2017 8:06 am

From the SpecialTriggers.htm file located in the RF docs:
When the player dies in a level you have several options of what can happen next. When the player's death animation is started a trigger called PlayerDeath is set to on. This can be used to trigger special effects or special camera sequences when the player dies. As well, you can control what happens after the death animation has finished.

In the PlayerSetup.ini file in the [Misc] section there is an entry called restartafterdeath. If this is true then pressing the ESC key after the death animation is finished will cause the level to restart. If it is false then a trigger called DeathESC is set to on and can be used to activate other entities that will cause the level to end or change to another level. If you press the Space bar after the death animation a trigger called DeathSpace is set to on. This also can be used to trigger other entities. This trigger is independent of the state of restartafterdeath.

Just remember, if restartafterdeath is false then a ChangeLevel entity must be activated at some point or the level will never end and you will be stuck at the point of death. If you choose to ignore the DeathESC trigger then the PlayerDeath trigger must activate a ChangeLevel entity or you remain stuck at death.
So basically you can use PlayerDeath or DeathESC to trigger your message.

User avatar
aicd99
Posts: 264
Joined: Mon Oct 10, 2011 11:17 am

Re: How to do a death message when the player dies

Post by aicd99 » Sun Jan 08, 2017 8:44 am

Basically my death message will be

[Ouch]
Game Over press Esc to try again
from message.txt

When you press Esc game you restart
Capture.PNG
PlayerSetup Entity
Capture.PNG (11.09 KiB) Viewed 6273 times
Please can you make it possible ?

User avatar
seppgirty
Posts: 161
Joined: Sat May 16, 2015 12:37 am
Location: Pittsburgh, Pa.
Contact:

Re: How to do a death message when the player dies

Post by seppgirty » Sun Jan 08, 2017 3:23 pm

Last edited by QuestOfDreams on Sun Jan 08, 2017 7:23 pm, edited 1 time in total.
Reason: No need to copy the entire manual section here
Gamer, Lover, Film maker,

http://www.chaosbrosfilms.com

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: How to do a death message when the player dies

Post by QuestOfDreams » Sun Jan 08, 2017 7:21 pm

aicd99 wrote:Basically my death message will be

[Ouch]
Game Over press Esc to try again
from message.txt

When you press Esc game you restart

Capture.PNG

Please can you make it possible ?
  1. The DeathMessage entry in the PlayerSetup entity is the actual text that will be displayed (i.e. it is not a reference to a section in the message.txt file)
  2. The DeathFontSize entry in the PlayerSetup entity must refer to a valid font as defined in the menu.ini file. Note that in the default RF installation FontSize 0 (i.e. FONT1 in menu.ini) is not defined and no message will appear with the setup above. In the log file you will find the following warning in that case:
    No defined Font # 0 (FONT1 in Menu.ini)

User avatar
aicd99
Posts: 264
Joined: Mon Oct 10, 2011 11:17 am

Re: How to do a death message when the player dies

Post by aicd99 » Mon Jan 09, 2017 4:50 am

I got the thing to work finally thank you Quest of Dreams

I found a bug in the Deathfontsize entry I had to type 12 to get font 13
which is the default message text "Adventure26" FONT.

To get FONT8 I had to type 7 in the deathfontsize entry in the player setup entity

Is their a way to get the message to display before you press ESC ? and not after ?

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: How to do a death message when the player dies

Post by QuestOfDreams » Mon Jan 09, 2017 10:08 am

aicd99 wrote:I found a bug in the Deathfontsize entry I had to type 12 to get font 13
which is the default message text "Adventure26" FONT.

To get FONT8 I had to type 7 in the deathfontsize entry in the player setup entity
This may be an unfortunate design decision but it's not a bug and it's clearly documented in the manual:
http://www.realityfactory.info/cms/inde ... tmap-fonts
aicd99 wrote:Is their a way to get the message to display before you press ESC ? and not after ?
You can set up a message entity that gets triggered by the 'PlayerDeath' trigger as mentioned in Allanon's post.

Post Reply