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
#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


Messages In This Thread
RE: Can someone help out with this Script? - by Cocomunches - 04-29-2012, 06:10 AM



Users browsing this thread: 1 Guest(s)