Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting
Nocturnal Offline
Member

Posts: 96
Threads: 14
Joined: Dec 2014
Reputation: 0
#1
Scripting

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!
06-22-2015, 05:17 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#2
RE: Scripting

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/th...fter+death

(This post was last modified: 06-22-2015, 07:14 AM by 7heDubz.)
06-22-2015, 07:14 AM
Find
Nocturnal Offline
Member

Posts: 96
Threads: 14
Joined: Dec 2014
Reputation: 0
#3
RE: Scripting

(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/th...fter+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.
06-22-2015, 03:42 PM
Find
A.M Team Offline
Banned

Posts: 811
Threads: 63
Joined: Sep 2014
#4
RE: Scripting

Copy the folder of the .ent file and put it in a new folder inside your CS/FC called entities.
06-22-2015, 06:17 PM
Find
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#5
RE: Scripting

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

Spoiler below!
PHP Code: (Select All)
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.
06-22-2015, 06:36 PM
Find
Artsy Offline
Member

Posts: 213
Threads: 10
Joined: Feb 2014
Reputation: 9
#6
RE: Scripting

Just reactivate the enemy in the CheckPoint callback.
06-22-2015, 06:44 PM
Find
Nocturnal Offline
Member

Posts: 96
Threads: 14
Joined: Dec 2014
Reputation: 0
#7
RE: Scripting

(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: (Select All)
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.
(This post was last modified: 06-22-2015, 07:29 PM by Nocturnal.)
06-22-2015, 07:27 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: Scripting

PHP Code: (Select All)
SetEntityActive("NameOfEnemy"true); 

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

06-22-2015, 07:37 PM
Find
Nocturnal Offline
Member

Posts: 96
Threads: 14
Joined: Dec 2014
Reputation: 0
#9
Information  RE: Scripting

(06-22-2015, 07:37 PM)Mudbill Wrote:
PHP Code: (Select All)
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.
06-22-2015, 09:37 PM
Find
SwingsDarkCreeps Offline
Junior Member

Posts: 26
Threads: 3
Joined: Jun 2015
Reputation: 0
#10
RE: Scripting

(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
(This post was last modified: 07-05-2015, 09:14 PM by SwingsDarkCreeps.)
07-05-2015, 09:11 PM
Find




Users browsing this thread: 3 Guest(s)