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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No script working on my custom story *SOLVED*
modoscar Offline
Junior Member

Posts: 9
Threads: 3
Joined: Jun 2012
Reputation: 0
#1
No script working on my custom story *SOLVED*

No script i've tried works when i try them on my custom map and i have looked everywhere without finding any answers.
Example of a script: An inactive monster should become active when some oil gets picked up,

"monster_oil" is the item that should activate the monster servant_brute_1, (they have the same name in the script and in the map)


void OnStart()
{

SetEntityPlayerInteractCallback("monster_oil", "Spawn_Monster", true);

}

void Spawn_Monster(string &in entity)
{

SetEntityActive("servant_brute_1", true);

}

My .map and .hps file has the same name. And is in the "maps" file. All help is appreciated!
(This post was last modified: 06-09-2012, 06:26 PM by modoscar.)
06-09-2012, 03:49 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#2
RE: No script working on my custom story

Try this:

void OnStart()
{

SetEntityCallbackFunc("monster_oil", "OnPickup");

}


void OnPickup(string &in asEntity, string &in type)
{

SetEntityActive("servant_brute_1", true);

}

I hope this explains something.

void SetEntityCallbackFunc(string& asName, string& asCallback);
Calls a function when the player interacts with a certain entity.
Callback
syntax: void MyFunc(string &in asEntity, string &in
type)

Type depends on entity type and includes: “OnPickup”,
“Break”, “OnIgnite”, etc

(This post was last modified: 06-09-2012, 05:34 PM by Datguy5.)
06-09-2012, 05:30 PM
Find
modoscar Offline
Junior Member

Posts: 9
Threads: 3
Joined: Jun 2012
Reputation: 0
#3
RE: No script working on my custom story

(06-09-2012, 05:30 PM)Datguy5 Wrote: Try this:

void OnStart()
{

SetEntityCallbackFunc("monster_oil", "OnPickup");

}


void OnPickup(string &in asEntity, string &in type)
{

SetEntityActive("servant_brute_1", true);

}

I hope this explains something.

void SetEntityCallbackFunc(string& asName, string& asCallback);
Calls a function when the player interacts with a certain entity.
Callback
syntax: void MyFunc(string &in asEntity, string &in
type)

Type depends on entity type and includes: “OnPickup”,
“Break”, “OnIgnite”, etc
I tried that and still nothing happens when i pickup the oil, i dont think it's script that there's something wrong with. Its like the game ignores the script, i've tried several basic scripts, like spawning with a lantern in the inventory and even that wont work.

:EDIT: I had forgotten to save as "all types" and i changed that and i just SH*T myself cause ur script worked and i got punched in the face! Thanks! Big Grin
(This post was last modified: 06-09-2012, 06:21 PM by modoscar.)
06-09-2012, 06:08 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#4
RE: No script working on my custom story *SOLVED*

Np,glad i could help Smile

06-09-2012, 06:33 PM
Find




Users browsing this thread: 2 Guest(s)