Frictional Games Forum (read-only)

Full Version: Monster spawn again after die
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How can I script that the monster(s) spawn again after I die?

And one more question: How can a monster fall after a few seconds into dust?
void FadeEnemyToSmoke(string& asName, bool abPlaySound);

Instantly fades an enemy to smoke.
For the first question, instead of deleting the callback after used, set it to false so it doesn't...
You can't respawn monsters that kill you.
It does work some way. The monster will get spawned at the position in the level editor again, but I think the monster will then know your position and run towards you. Set the callback that sets the enemy Entity active false at the part where it deletes once activated.
OK
Make a monster to dust is checked.
But I still not understand how to respawn a monster after a die.
--------------
New problem [problems over problems -.-] my extra_english.lang file doesn`t work.
Code:
<LANGUAGE>
<CATEGORY Name="My map">
<Entry Name="Description">My description</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
    <Entry Name="Note_Hinweis1_Name">Welcome to my Mansion</Entry>
    <Entry Name="Note_Hinweis1_Text"Search the keys for the next room.[br]Have fun! MUHAHAHA</Entry>
    <Entry Name="Note_Hinweis2_Name">Advice</Entry>
    <Entry Name="Note_Hinweis2_Text">Use it to open the leveldoor</Entry>
    <Entry Name="Note_Hinweis3_Name">...</Entry>
    <Entry Name="Note_Hinweis3_Text">I hope you now what to do!</Entry>
</CATEGORY>
</LANGUAGE>
"Hinweis" is german and means clue.
I can`t read the clues in my custom story. There is not a text.
I used to try a sign, too, but it didn`t work.
I am not sure about the monster - you could maybe edit it's setting in the Model Editor and perhaps change it so it doesn't despawn when you are dead? And about the .lang you have there, try adding <RESOURCES></RESOURCES>.

Don't put anything between the RESOURCES, just put it in the .lang, but make sure you paste it inside <LANGUAGE> </LANGUAGE>. Or try this;
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">My Description.</Entry>
</CATEGORY>
put that there INSTEAD of
<CATEGORY Name="My map">
<Entry Name="Description">My description</Entry>
</CATEGORY>

I think this is the problem. Hopefully that works.
Viel Glück und Spaß!
There is no problem with the extra_english.lang file. Make sure you used the option "NoteText" when you select a note, not the name.
For the respawn monster part:
I'll give you an example script:
PHP Code:
void OnStart()
{
 
AddEntityCollideCallback("Player""SCRIPT_AREA_NAME_HERE""SpawnMonster"false1);
//The false makes it so the callback won't get removed once triggered
}
void SpawnMonster(string &in asParentstring &in asChildint alState)
{
SetEntityActive("ENEMY_NAME_HERE"true);
//All the path nodes go here!
AddEnemyPatrolNode("ENEMY_NAME_HERE""PathNodeArea_1"0"");
AddEnemyPatrolNode("ENEMY_NAME_HERE""PathNodeArea_2"0"");
AddEnemyPatrolNode("ENEMY_NAME_HERE""PathNodeArea_3"0"");

If you instead want the monster to stop reappearing after, let's say, 3 deaths, or you want the monster to appear RIGHT after you respawned instead of going through a script area first, you will have to do a bit more work that will include a Local Variable and/or the command
CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);
Might want to know that the monster WILL know your position and WILL run full speed towards you after he's set active again.
If you instead ment a way of reappearing like a patrolling grunt who is not supposed to know your position once spawned, you can try making a bunch of grunts set inactive at the same position, and at every death(checkpoint command used)you set a variable higher by 1 and the enemy_variable will be set active. I think 5 should be the max, I don't think anyone would fail 5 times there. And if someone does, you can add a troll message like "the enemy will no longer appear, because you suck too much to avoid it" or something.
The monster spawns again THX
But the extra_english.lang file still doesn´t work.
Yes I have EXACTLY the same name as the name in NoteText.
And there is not a description to my story :S
<CATEGORY Name="My map">
< Entry Name="Description">My description</Entry>
Category name for the description must always be CustomStoryMain
so it's
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">My description</Entry>
(07-08-2012, 08:56 PM)FastHunteR Wrote: [ -> ]< Entry Name="Description">My description

Category name for the description must always be CustomStoryMain

so it's



My description



It works. But if I insert
Code:
<CATEGORY Name="Journal">
    <Entry Name="Note_Hinweis1_Name">Welcome to my Mansion</Entry>
    <Entry Name="Note_Hinweis1_Text"Search the keys for the next room.[br]Have fun! MUHAHAHA</Entry>
    <Entry Name="Note_Hinweis2_Name">Advice</Entry>
    <Entry Name="Note_Hinweis2_Text">Use it to open the leveldoor</Entry>
    <Entry Name="Note_Hinweis3_Name">...</Entry>
    <Entry Name="Note_Hinweis3_Text">I hope you now what to do!</Entry>
    </CATEGORY>
between </CATEGORY> and </LANGUAGE> The lang file doesn´t work.
Pages: 1 2