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?
JetlinerX Offline
Senior Member

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

Oh, his callback mistake?

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

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

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

Okay, so I sorta got it to work!

but the new problem is that it now spawns the same monster instead of the other monster that is to break down the door.

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 OnPickup2(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 byegrunt2(string &in asTimer)
{
SetEntityActive ("baisle", false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(2.0f, 0);
}
04-29-2012, 05:23 AM
Find
JetlinerX Offline
Senior Member

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

You changed your callback again, and now your functions dont match. Here is the corrected version. Please try to look through the changes.

CHANGELOG:

- Brought both SetEntityInteractCallbacks to the OnStart area
- Changed second OnPickup to match the function below. (OnPickup2)

I think you may be having the same problem I did when I first started scripting. The "function to call" does not have to be specific to the action. Technically, you could do this:

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

As long as it matches below like this:

void BLAHBLAHBLAHBLAH(string &in asEntity)

void OnStart()

{
SetEntityPlayerInteractCallback("scareactive2", "OnPickup", true);
SetEntityPlayerInteractCallback("celltwelvekey", "OnPickup2", 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, "");
}
///////////TIMER////////////////
void byegrunt(string &in asTimer)
{
SetEntityActive ("Monster_Grunt", false);
}
//////////OnPickup2//////////////
void OnPickup2(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, "");
}

//////////////TIMER2//////////////
void byegrunt2(string &in asTimer)

{
SetEntityActive ("baisle", false);
}

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

// Run when leaving map

void OnLeave()

{

StopMusic(2.0f, 0);

}

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 04-29-2012, 05:47 AM by JetlinerX.)
04-29-2012, 05:41 AM
Website Find
Cocomunches Offline
Junior Member

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

(04-29-2012, 05:41 AM)JetlinerX Wrote: You changed your callback again, and now your functions dont match. Here is the corrected version. Please try to look through the changes.

CHANGELOG:

- Brought both SetEntityInteractCallbacks to the OnStart area
- Changed second OnPickup to match the function below. (OnPickup2)

I think you may be having the same problem I did when I first started scripting. The "function to call" does not have to be specific to the action. Technically, you could do this:

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

As long as it matches below like this:

void BLAHBLAHBLAHBLAH(string &in asEntity)

void OnStart()

{
SetEntityPlayerInteractCallback("scareactive2", "OnPickup", true);
SetEntityPlayerInteractCallback("celltwelvekey", "OnPickup2", 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, "");
}
///////////TIMER////////////////
void byegrunt(string &in asTimer)
{
SetEntityActive ("Monster_Grunt", false);
}
//////////OnPickup2//////////////
void OnPickup2(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, "");
}

//////////////TIMER2//////////////
void byegrunt2(string &in asTimer)

{
SetEntityActive ("baisle", false);
}

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

// Run when leaving map

void OnLeave()

{

StopMusic(2.0f, 0);

}
Aha! It works! Thank you very much.

I really need to learn how to script and keep everything neat and orderly!


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

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

No problem, I am glad to help. If you need any help learning, or keeping it organized, feel free to holler at me Wink

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

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

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

(04-29-2012, 06:17 AM)JetlinerX Wrote: No problem, I am glad to help. If you need any help learning, or keeping it organized, feel free to holler at me Wink
Do you have a Skype or Steam account?

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

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

Skype: airbusual

Steam: (Contact me on Skype, because it was an auto generated name, so its soooo stupid!) xD

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-30-2012, 01:08 AM
Website Find




Users browsing this thread: 2 Guest(s)