Frictional Games Forum (read-only)
Scripting - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Scripting (/thread-30154.html)



Scripting - Nocturnal - 06-22-2015

I would like to know how to make a monster not go away when you die, and when you not look at them and when you go far away enough to go away. could you please help me with that? then also making different changes like damage and speed, and time between attacks with any monster. thanks!


RE: Scripting - 7heDubz - 06-22-2015

There's this amazing, feature, let's give it a go.

I like to call it the "search" function.

[Image: ac608d89a3.png]

Lets try something that you want,

[Image: 7d8dd501df.png]


Here we go.

[Image: 1fee2fc8c2.png]


This one has some good info in it!

https://www.frictionalgames.com/forum/thread-18354.html?highlight=monster+stay+after+death


RE: Scripting - Nocturnal - 06-22-2015

(06-22-2015, 07:14 AM)7heDubz Wrote: There's this amazing, feature, let's give it a go.

I like to call it the "search" function.

[Image: ac608d89a3.png]

Lets try something that you want,

[Image: 7d8dd501df.png]


Here we go.

[Image: 1fee2fc8c2.png]


This one has some good info in it!

https://www.frictionalgames.com/forum/thread-18354.html?highlight=monster+stay+after+death

I don't want to have to edit the .ent file, but if i could duplicate it then I will do that, but i heard that i could edit it's behavior with script.


RE: Scripting - A.M Team - 06-22-2015

Copy the folder of the .ent file and put it in a new folder inside your CS/FC called entities.


RE: Scripting - Slanderous - 06-22-2015

About monster that won't disappear after player's death, use checkpoint function.

Spoiler below!
PHP Code:
void CheckPoint (stringasNamestringasStartPosstringasCallbackstringasDeathHintCatstringasDeathHintEntry);

Sets a checkpoint at which the player will respawn in case he dies.
Callback syntaxvoid MyFunc(string &in asNameint alCount)
Count is 0 on the first checkpoint load!

asName the internal name
asStartPos 
the name of the StartPos in the editor
asCallback 
the function to call when the player dies/respawns
asDeathHintCat 
the category of the death hint message to be used in the .lang file
asDeathHintEntry 
the entry in the .lang file 


Basically, this site is your best friend when it comes to script stuff.


RE: Scripting - Artsy - 06-22-2015

Just reactivate the enemy in the CheckPoint callback.


RE: Scripting - Nocturnal - 06-22-2015

(06-22-2015, 06:36 PM)Diamond Lazzer Wrote: About monster that won't disappear after player's death, use checkpoint function.

Spoiler below!
PHP Code:
void CheckPoint (stringasNamestringasStartPosstringasCallbackstringasDeathHintCatstringasDeathHintEntry);

Sets a checkpoint at which the player will respawn in case he dies.
Callback syntaxvoid MyFunc(string &in asNameint alCount)
Count is 0 on the first checkpoint load!

asName the internal name
asStartPos 
the name of the StartPos in the editor
asCallback 
the function to call when the player dies/respawns
asDeathHintCat 
the category of the death hint message to be used in the .lang file
asDeathHintEntry 
the entry in the .lang file 


Basically, this site is your best friend when it comes to script stuff.

Thanks! i am pretty horrible at c++ programming and amnesia scripting anyway, so thanks very much, and i know that site lol. I just couldn't find that code there, but thanks for pointing this out :3

(06-22-2015, 06:44 PM)Malakai Wrote: Just reactivate the enemy in the CheckPoint callback.

Yeah.... just one problem. How do I do that?

(06-22-2015, 06:17 PM)TheDoctorPoo Wrote: Copy the folder of the .ent file and put it in a new folder inside your CS/FC called entities.

Sure, I could do that! thanks for the help. Much apreciated.


RE: Scripting - Mudbill - 06-22-2015

PHP Code:
SetEntityActive("NameOfEnemy"true); 

This will enable the enemy. Put it into your CheckPoint callback and it will happen every time you die.


RE: Scripting - Nocturnal - 06-22-2015

(06-22-2015, 07:37 PM)Mudbill Wrote:
PHP Code:
SetEntityActive("NameOfEnemy"true); 

This will enable the enemy. Put it into your CheckPoint callback and it will happen every time you die.

Thanks Mudbill! You never seem to fail me lol. But seriously though, it's been good feedback the last, oh right, it was only about twice. well thanks! i will also put that in with the checkpoint code.


RE: Scripting - SwingsDarkCreeps - 07-05-2015

(06-22-2015, 05:17 AM)GameEnthusiast Wrote: I would like to know how to make a monster not go away when you die, and when you not look at them and when you go far away enough to go away. could you please help me with that? then also making different changes like damage and speed, and time between attacks with any monster. thanks!

ResetProp("nameoftheenemy") is a good method.
In my script looks likeShy:
void OnStart()

{
CheckPoint ("thecheckpoint", "PlayerStartArea_2", "PlayerIsDead", "TheCategoryNameWhenPlayerDie", "TheEntryNameWhenPlayerDie");//but you need an extra english.lang file
}

void PlayerIsDead(string &in asName, int alCount)
{
ResetProp("servant_grunt_1");//this function spawn again the enemy after you die
SetEntityActive("servant_grunt_1", true);
}
Rolleyes