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
Unexpected Token
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#11
RE: Unexpected Token

Lol xD

05-31-2014, 02:48 AM
Find
Aglowglint11 Offline
Junior Member

Posts: 31
Threads: 8
Joined: Mar 2014
Reputation: 0
#12
RE: Unexpected Token

XD I mean I'm having problems with this script file now. The other one is fixed but I'm getting the same problem with this one but it's '{' Lol!



// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "SoundArea_1", "Sound_1", true, 1);
AddEntityCollideCallback("Player", "fallarea", "fall", true, 1);
AddEntityCollideCallback("Player", "SoundArea_2", "Sound_2", true, 1);
AddEntityCollideCallback("Player", "SoundArea_3", "Sound_3", true, 1);
AddEntityCollideCallback("Player", "SoundArea_4", "Sound_4", true, 1);
AddEntityCollideCallback("Player", "SoundArea_5", "Sound_5", true, 1);
AddEntityCollideCallback("Player", "SoundArea_6", "Sound_5", true, 1);
AddEntityCollideCallback("Player", "SoundArea_7", "Sound_5", true, 1);
AddUseItemCallback("", "Key", "Door", "UsedKeyonDoor", true);
}
void fall(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("2", true);
SetEntityActive("3", true);
SetEntityActive("4", true);
SetEntityActive("5", true);
SetEntityActive("6", true);
}

void Sound_1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_rock.snt", "Player", 0, false);
}
void UsedKeyonDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door", false,true);
PlaySoundAtEntity("", "unlock_door", "Door", 0, false);
RemoveItem("Key");
}

void Sound_2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_iron_maiden.snt", "Player", 0, false);
}

void Sound_3(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
}

void Sound_4(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
}

void Sound_5(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_mb_04.snt", "Player", 0, false);
}

void Sound_6(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "18_blow_wind.snt", "Player", 0, false);
}

void Sound_7(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_idle.snt", "Player", 0, false);
AddEntityCollideCallback("Player", "AreaCollide", "EventCollide", true, 1);
AddEntityCollideCallback("Player", "AreaCollide_2", "EventCollide", true, 1);
}

{
SetEntityActive("Grunt", true);

AddEnemyPatrolNode("Grunt", "Node_1", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_2", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_3", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_4", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_5", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_6", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_7", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_8", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_9", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_10", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_11", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_12", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_13", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_14", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_15", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_16", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_17", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_18", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_19", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_20", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_21", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_22", 0.001f, "");
AddEnemyPatrolNode("Grunt", "Node_23", 0.001f, "");
}

void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Demon", true);

AddEnemyPatrolNode("Demon", "Path_1", 0.001f, "");
AddEnemyPatrolNode("Demon", "Path_2", 0.001f, "");
AddEnemyPatrolNode("Demon", "Path_3", 0.001f, "");
AddEnemyPatrolNode("Demon", "Path_4", 0.001f, "");
AddEnemyPatrolNode("Demon", "Path_5", 0.001f, "");
AddEnemyPatrolNode("Demon", "Path_6", 0.001f, "");
AddEnemyPatrolNode("Demon", "Path_7", 0.001f, "");
AddEnemyPatrolNode("Demon", "Path_8", 0.001f, "");
AddEnemyPatrolNode("Demon", "Path_9", 0.001f, "");
AddEnemyPatrolNode("Demon", "Path_10", 0.001f, "");
AddEnemyPatrolNode("Demon", "Path_11", 0.001f, "");
AddEnemyPatrolNode("Demon", "Path_12", 0.001f, "");
}

I fixed the problem, I needed a

void EventCollide(string &in asParent, string &in asChild, int alState)

Inbetween the two { and }

But when I pass the area's I have placed the monster's aren't Setting to Active.
(This post was last modified: 05-31-2014, 12:56 PM by Aglowglint11.)
05-31-2014, 12:45 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#13
RE: Unexpected Token

Have you added the appropriate AddEntityCollideCallback for EventCollide to the OnStart()?

Discord: Romulator#0001
[Image: 3f6f01a904.png]
05-31-2014, 01:07 PM
Find
Aglowglint11 Offline
Junior Member

Posts: 31
Threads: 8
Joined: Mar 2014
Reputation: 0
#14
RE: Unexpected Token

(05-31-2014, 01:07 PM)Romulator Wrote: Have you added the appropriate AddEntityCollideCallback for EventCollide to the OnStart()?

I'm not sure, what would it look like?

(05-31-2014, 01:07 PM)Romulator Wrote: Have you added the appropriate AddEntityCollideCallback for EventCollide to the OnStart()?

I'm not sure, what would it look like?
(This post was last modified: 05-31-2014, 01:13 PM by Aglowglint11.)
05-31-2014, 01:13 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#15
RE: Unexpected Token

Well, you have added it to the collision event with the Sound_7 routine.

This means that it won't happen unless you cause the Sound_7 routine to begin, which apparently does not happen at all, because when the player collides with SoundArea_7, it runs Sound_5 instead.

Check your OnStart() code again, and just fix that up. If you want to as well, unless it affects your code, take the two AddEntityCollideCallbacks in the Sound_7 and add them to OnStart(), like this:

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""SoundArea_1""Sound_1"true1);
AddEntityCollideCallback("Player""fallarea""fall"true1);
AddEntityCollideCallback("Player""SoundArea_2""Sound_2"true1);
AddEntityCollideCallback("Player""SoundArea_3""Sound_3"true1);
AddEntityCollideCallback("Player""SoundArea_4""Sound_4"true1);
AddEntityCollideCallback("Player""SoundArea_5""Sound_5"true1);
AddEntityCollideCallback("Player""SoundArea_6""Sound_5"true1);
AddEntityCollideCallback("Player""SoundArea_7""Sound_5"true1);
AddUseItemCallback("""Key""Door""UsedKeyonDoor"true);
AddEntityCollideCallback("Player""AreaCollide""EventCollide"true1);
AddEntityCollideCallback("Player""AreaCollide_2""EventCollide"true1);  //Note: This will run EventCollide again.


Your second last block of code (above) is missing a void as well. I assume that this is the one you have fixed as well.

Also, for the sake of scrolling, just as a general tip, enclose your code in a spoiler tag.

[spoiler]Insert Code Here[/spoiler]

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 05-31-2014, 01:37 PM by Romulator.)
05-31-2014, 01:30 PM
Find
Aglowglint11 Offline
Junior Member

Posts: 31
Threads: 8
Joined: Mar 2014
Reputation: 0
#16
RE: Unexpected Token

This did work, thanks Big Grin

N00B
05-31-2014, 01:40 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#17
RE: Unexpected Token

Glad I could help! Smile

Good luck on your project, and let us know if you need more help! Big Grin

Discord: Romulator#0001
[Image: 3f6f01a904.png]
05-31-2014, 01:43 PM
Find
Aglowglint11 Offline
Junior Member

Posts: 31
Threads: 8
Joined: Mar 2014
Reputation: 0
#18
RE: Unexpected Token

Thanks Big Grin

N00B
05-31-2014, 01:45 PM
Find




Users browsing this thread: 2 Guest(s)