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
Script Help Cant see the error :S
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#1
Cant see the error :S

wtf? i dont see anything so i guess i will learn a new thing today Big Grin

Errors:

main (11,1);ERR;Expected "," or ';'
main (27,1) Same as above

Here's the rows:

11: void monsterActive(string &in asParent, string &in asChild, int alState)

27: void Happening(string &in asName, int alCount)

PS: im using notepad++
(This post was last modified: 05-25-2013, 01:37 PM by Darkboot.)
05-25-2013, 01:34 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#2
RE: Cant see the error :S

Could you give us more of the script?
05-25-2013, 01:39 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#3
RE: Cant see the error :S

Yeah. If you are ever having troubles with script, you should post the entire thing. Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
05-25-2013, 01:45 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#4
RE: Cant see the error :S

i dont know how but its only 11,1 now and it is Another one since i moves 27,1. Here's the script Smile

void OnStart()

{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
GiveItemFromFile("lantern", "lantern.ent");
AddEntityCollideCallback("Player", "enemy_spawner_1", "monsterActive", true, 1);
AddEntityCollideCallback("Player", "PlayerStartArea_1", "Restart", true, 1);
}

void Restart(string &in asParent, string &in asChild, int alState)
void UsedKeyOnDoor(string &in asItem, string &in asEntity) <---- thats 11,1
void monsterActive(string &in asParent, string &in asChild, int alState)

{
SetEntityActive("enemy_spawner_2", true);
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_2", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_1", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_4", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_5", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_6", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_7", 1.0f, "");
CheckPoint ("FirstCheckpoint", "PlayerStartArea_1", "Happening", "DeathCategory", “Deathtext”);
}

void Happening(string &in asName, int alCount)

{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("","unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}

void OnEnter()

{
FadeOut(0.0f);
FadeIn(5.0f);
}


void OnLeave()
{

}
(This post was last modified: 05-25-2013, 01:48 PM by Darkboot.)
05-25-2013, 01:47 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#5
RE: Cant see the error :S

You have several functions behind each other without the {} for the function. I'm talking about line 10, 11 and 12.
05-25-2013, 01:51 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#6
RE: Cant see the error :S

What? O.o
05-25-2013, 02:07 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#7
RE: Cant see the error :S

This:
void Restart(string &in asParent, string &in asChild, int alState)
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
void monsterActive(string &in asParent, string &in asChild, int alState)

Needs to be:

void Restart(string &in asParent, string &in asChild, int alState)
{
//functions
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
//functions
}
void monsterActive(string &in asParent, string &in asChild, int alState)
{
//functions
}
05-25-2013, 02:14 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#8
RE: Cant see the error :S

The correct way to have your script is like
PHP Code: (Select All)
void OnStart()

 {
 
AddUseItemCallback("""awesomekey_1""mansion_1""UsedKeyOnDoor"true);
 
GiveItemFromFile("lantern""lantern.ent");
 
AddEntityCollideCallback("Player""enemy_spawner_1""monsterActive"true1);
 
AddEntityCollideCallback("Player""PlayerStartArea_1""Restart"true1); 
 } 
Which you have done, but you haven't done this with your things below.
Think of it like this:
PHP Code: (Select All)
void myfunction(asStringasEntityetc)
{
//place what I want to happen in here


Using an example from your code:
Assuming you want the door to unlock when you use the key on it in your code, you would have this.

PHP Code: (Select All)
void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
 
SetSwingDoorLocked("mansion_1"falsetrue);
 
PlaySoundAtEntity("","unlock_door""mansion_1"0false);
 
RemoveItem("awesomekey_1");
 } 

Discord: Romulator#0001
[Image: 3f6f01a904.png]
05-25-2013, 02:17 PM
Find
Darkboot Offline
Junior Member

Posts: 31
Threads: 8
Joined: Jun 2012
Reputation: 0
#9
RE: Cant see the error :S

okey, i deleted the checkpoint thing cause that was just a Little test and then i changed so it looks like you guys said. But i seriously dont get this.. i dont get any description on my key or the the custom story main window.. why? :S
void OnStart()


{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
GiveItemFromFile("lantern", "lantern.ent");
AddEntityCollideCallback("Player", "enemy_spawner_1", "monsterActive", true, 1);
}

void monsterActive(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_spawner_2", true);
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_2", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_3", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_4", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_5", 10.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_6", 5.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_7", 3.0f, "");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("","unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}

void OnEnter()

{
FadeOut(0.0f);
FadeIn(5.0f);
}


void OnLeave()
{

}
(This post was last modified: 05-25-2013, 04:26 PM by Darkboot.)
05-25-2013, 03:37 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#10
RE: Cant see the error :S

Your code is still incorrect.
Could you post what you would like to happen? For example:
I unlock a door. Once the door is unlocked, I get Sanity, but another door behind me slams shut.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
05-25-2013, 03:45 PM
Find




Users browsing this thread: 1 Guest(s)