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
Can someone help out with this Script?
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#1
Can someone help out with this Script?

Hey, if you or anyone else can help me out with this, I keep getting similar errors from last time.



Quote:Quote:////////////////////////////

// Run when entering map

void OnStart()



{

SetEntityPlayerInteractCallback("scareactive2", "OnPickup", true);

}



void OnPickup(string &in asEntity)

{

SetEntityActive ("Monster_Grunt", true);

AddTimer("monsterstart", 60.0f, "byegrunt");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_1", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_2", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_3", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_4", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_5", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_6", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_7", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_8", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_9", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_10", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_11", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_12", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_13", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_14", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_15", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_16", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_17", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_18", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_19", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_20", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_21", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_22", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_23", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_24", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_25", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_26", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_27", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_28", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_29", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_30", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_31", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_32", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_33", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_34", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_35", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_36", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_37", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_38", 0, "");

}



void byegrunt(string &in asTimer)

{

SetEntityActive ("Monster_Grunt", false);

}



{

SetEntityPlayerInteractCallback("celltwelvekey", "OnPickup", true);

}



void OnPickup(string &in asEntity)

{

SetEntityActive ("baisle", true);

AddTimer("monsterstart", 400.0f, "byegrunt");

AddEnemyPatrolNode("baisle", "PathNodeArea_39", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_40", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_41", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_42", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_43", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_44", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_45", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_46", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_47", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_48", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_49", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_50", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_51", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_52", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_53", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_54", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_55", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_56", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_57", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_58", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_59", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_60", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_61", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_62", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_63", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_64", 0, "");

}



void byegrunt(string &in asTimer)

{

SetEntityActive ("baisle", false);

}


////////////////////////////

// Run when leaving map

void OnLeave()

{

StopMusic(2.0f, 0);

}


The added part is where Basil (Monster) Is.


Keep getting errors and don't know what to fix!!!!


Also, if you have Steam or skype, please add me if you are willing to help me out with some more things:

Cocomunches (Steam)

Cocomunches1 (Skype)
04-29-2012, 01:59 AM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#2
RE: Can someone help out with this Script?

}

{

Noob scripting tutorial: From Noob to Pro

04-29-2012, 02:03 AM
Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#3
RE: Can someone help out with this Script?

(04-29-2012, 02:03 AM)Cranky Old Man Wrote:
}

{
How embarrassing.


(04-29-2012, 02:03 AM)Cranky Old Man Wrote:
}

{
So, what exactly do I fix?


(This post was last modified: 04-29-2012, 02:18 AM by Cocomunches.)
04-29-2012, 02:15 AM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#4
RE: Can someone help out with this Script?

(04-29-2012, 02:15 AM)Cocomunches Wrote:
(04-29-2012, 02:03 AM)Cranky Old Man Wrote:
}

{
How embarrassing.
So, what exactly do I fix?
Among the first things you learn, is how curly brackets work. I don't know what you were aiming for in the code, but that's not it. Curly brackets begin and end functions. They don't just start in the middle of nowhere. Either remove both those brackets, or write a function header. There might be other errors as well, but the main cause here seems to be that you need to learn scripting basics before you attempt writing huge amounts of code.
Here's a video tutorial:
https://www.youtube.com/watch?v=Rzkwl6IX...ature=plcp


Noob scripting tutorial: From Noob to Pro

04-29-2012, 02:50 AM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#5
RE: Can someone help out with this Script?

No, nothing is wrong with his {}, but his callbacks are all over, and you are calling back the same thing twice. Try this:

void OnStart()

{

SetEntityPlayerInteractCallback("celltwelvekey", "SecondMonster", true);

SetEntityPlayerInteractCallback("scareactive2", "OnPickup", true);

}



void OnPickup(string &in asEntity)



{

SetEntityActive ("Monster_Grunt", true);

AddTimer("monsterstart", 60.0f, "byegrunt");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_1", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_2", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_3", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_4", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_5", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_6", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_7", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_8", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_9", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_10", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_11", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_12", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_13", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_14", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_15", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_16", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_17", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_18", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_19", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_20", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_21", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_22", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_23", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_24", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_25", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_26", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_27", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_28", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_29", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_30", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_31", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_32", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_33", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_34", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_35", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_36", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_37", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_38", 0, "");

}


void byegrunt(string &in asTimer)



{

SetEntityActive ("Monster_Grunt", false);

}



void SecondMonster(string &in asEntity)



{

SetEntityActive ("baisle", true);

AddTimer("monsterstart", 400.0f, "byegrunt");

AddEnemyPatrolNode("baisle", "PathNodeArea_39", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_40", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_41", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_42", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_43", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_44", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_45", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_46", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_47", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_48", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_49", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_50", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_51", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_52", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_53", 0, "");



AddEnemyPatrolNode("baisle", "PathNodeArea_54", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_55", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_56", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_57", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_58", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_59", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_60", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_61", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_62", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_63", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_64", 0, "");

}







void byegrunt(string &in asTimer)



{



SetEntityActive ("baisle", false);

}



void OnLeave()

{

StopMusic(2.0f, 0);

}

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-29-2012, 04:24 AM
Website Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#6
RE: Can someone help out with this Script?

(04-29-2012, 04:24 AM)JetlinerX Wrote: No, nothing is wrong with his {}, but his callbacks are all over, and you are calling back the same thing twice. Try this:

void OnStart()

{

SetEntityPlayerInteractCallback("celltwelvekey", "SecondMonster", true);

SetEntityPlayerInteractCallback("scareactive2", "OnPickup", true);

}



void OnPickup(string &in asEntity)



{

SetEntityActive ("Monster_Grunt", true);

AddTimer("monsterstart", 60.0f, "byegrunt");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_1", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_2", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_3", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_4", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_5", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_6", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_7", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_8", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_9", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_10", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_11", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_12", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_13", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_14", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_15", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_16", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_17", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_18", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_19", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_20", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_21", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_22", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_23", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_24", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_25", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_26", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_27", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_28", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_29", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_30", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_31", 2, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_32", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_33", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_34", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_35", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_36", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_37", 0, "");

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_38", 0, "");

}


void byegrunt(string &in asTimer)



{

SetEntityActive ("Monster_Grunt", false);

}



void SecondMonster(string &in asEntity)



{

SetEntityActive ("baisle", true);

AddTimer("monsterstart", 400.0f, "byegrunt");

AddEnemyPatrolNode("baisle", "PathNodeArea_39", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_40", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_41", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_42", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_43", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_44", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_45", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_46", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_47", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_48", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_49", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_50", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_51", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_52", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_53", 0, "");



AddEnemyPatrolNode("baisle", "PathNodeArea_54", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_55", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_56", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_57", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_58", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_59", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_60", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_61", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_62", 0, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_63", 2, "");

AddEnemyPatrolNode("baisle", "PathNodeArea_64", 0, "");

}







void byegrunt(string &in asTimer)



{



SetEntityActive ("baisle", false);

}



void OnLeave()

{

StopMusic(2.0f, 0);

}
Thanks!


04-29-2012, 04:39 AM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#7
RE: Can someone help out with this Script?

(04-29-2012, 04:24 AM)JetlinerX Wrote: No, nothing is wrong with his {}, but his callbacks are all over, and you are calling back the same thing twice.
Yes, there was something wrong with his }{ (not {} ) and you even fixed what I was pointing out.


Noob scripting tutorial: From Noob to Pro

04-29-2012, 04:40 AM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#8
RE: Can someone help out with this Script?

I copy and pasted his code... I still dont see it. I must be blind or something. XD

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-29-2012, 04:42 AM
Website Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#9
RE: Can someone help out with this Script?

(04-29-2012, 04:42 AM)JetlinerX Wrote: I copy and pasted his code... I still dont see it. I must be blind or something. XD
Do you have Steam or Skype?


04-29-2012, 04:47 AM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#10
RE: Can someone help out with this Script?

(04-29-2012, 04:42 AM)JetlinerX Wrote: I copy and pasted his code... I still dont see it. I must be blind or something. XD
You simply can't write:

void func()
{
...
...
}

{
...
...
}

You have to write it like this:

void func()
{
...
...
...
...
}


Noob scripting tutorial: From Noob to Pro

04-29-2012, 04:57 AM
Find




Users browsing this thread: 2 Guest(s)