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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] What is wrong with this script?
Author Message
NylePudding Offline
Member

Posts: 77
Joined: Apr 2011
Reputation: 0
Post: #1
[SOLVED] What is wrong with this script?

When I start my custom story an error message comes up:

[Image: auxvrk.png]

Here is my script:


void OnStart()
{
AddTimer("tut01", 5, "Timer01");
AddTimer("tut02", 10, "Timer02");

void SetSwingDoorLocked(string& mansion_2, bool abLocked,

bool abEffects);


if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i,

"tinderbox.ent");
}
}



void Timer01(string &in asTimer)
{
SetMessage("Example", "Entry1", 0);

}

void Timer02(string &in asTimer)
{
SetEntityActive("servant_grunt_1" , true);
ShowEnemyPlayerPosition(string& servant_grunt_1);
}


void OnEnter()
{

}

void OnLeave()
{

}


So where do I have to place the brackets? Or is my code slightly wrong?

Thanks in advance. Big Grin
(This post was last modified: 04-29-2011 02:53 PM by NylePudding.)
04-29-2011 12:48 PM
Find all posts by this user Quote this message in a reply
laser50 Offline
Member

Posts: 242
Joined: Apr 2011
Reputation: 0
Post: #2
RE: What wrong with this script?

There are numbers.. 6 is line 6, and 25 is line 25..

bool (abEffects);

Not sure about this 1. because ijust think this is the fix for one.
04-29-2011 12:57 PM
Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,085
Joined: Mar 2009
Reputation: 67
Post: #3
RE: What is wrong with this script?

void SetSwingDoorLocked(string& mansion_2, bool abLocked, bool abEffects);
must be:
void SetSwingDoorLocked("mansion_2", true/false, true/false);

You should choose true or false.

04-29-2011 01:04 PM
Visit this user's website Find all posts by this user Quote this message in a reply
NylePudding Offline
Member

Posts: 77
Joined: Apr 2011
Reputation: 0
Post: #4
RE: What is wrong with this script?

(04-29-2011 01:04 PM)Tanshaydar Wrote:  void SetSwingDoorLocked(string& mansion_2, bool abLocked, bool abEffects);
must be:
void SetSwingDoorLocked("mansion_2", true/false, true/false);

You should choose true or false.

Okay now my sccript looks something like this:

void OnStart()
{
AddTimer("tut01", 5, "Timer01");
AddTimer("tut02", 10, "Timer02");

SetSwingDoorLocked "mansion_2", true, false);


if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}
}


void Timer01(string &in asTimer)
{
SetMessage("Example", "Entry1", 0);

}

void Timer02(string &in asTimer)
{
SetEntityActive("servant_grunt_1" , true);
ShowEnemyPlayerPosition(string& servant_grunt_1);
}


void OnEnter()
{

}

void OnLeave()
{

}

And now this error message comes up:

[Image: 23rwztu.png]
(This post was last modified: 04-29-2011 01:26 PM by NylePudding.)
04-29-2011 01:22 PM
Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,085
Joined: Mar 2009
Reputation: 67
Post: #5
RE: [UNSOLVED] What is wrong with this script?

SetSwingDoorLocked "mansion_2", true, false);

must be:

SetSwingDoorLocked("mansion_2", true, false);
--------------
ShowEnemyPlayerPosition(string& servant_grunt_1);

must be:

ShowEnemyPlayerPosition("servant_grunt_1");
--------------------------------

Do not forget, if it says string&, then you have to write a string like "this is me hell yeah!" with quotes.

(This post was last modified: 04-29-2011 01:32 PM by Tanshaydar.)
04-29-2011 01:32 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)