Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wall script
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#41
RE: Wall script

(03-08-2012, 11:32 AM)flamez3 Wrote: No. You can have as many as you need. Only that the functions have different names.
If you say so, I'll try that
EDIT: HA! I F*CKING KNEW IT!
main 67,1:ERR: A function with the same name and parameters already exist
main 6,1 ERR: No matching signatures to AddUseItemCallback(string@&, string@&, string@& const bool

Btw, the script looks like that now:
//Cell wall
void OnStart()
{
AddUseItemCallback("", "stone_hammer_chipper", "cell_breakable_wall_1", "BreakWall", false);
}
void BreakWall(string &in asItem, string &in asEntity)
{
//SetSwingDoorLocked("cell_breakable_wall_1", false, true);
//PlaySoundAtEntity("", "unlock_door", "cell_breakable_wall_1", 0, false)
SetEntityActive("cell_breakable_wall_1", false);
SetEntityActive("cell_breakable_wall_broken_1", true);
}

void OnLeave()
{

}

(This post was last modified: 03-08-2012, 11:53 AM by Saren.)
03-08-2012, 11:38 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#42
RE: Wall script

If you listened. I said only if the callbacks had 2 different function names. Screw it. Just give em the script and i'll fix it

03-08-2012, 12:20 PM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#43
RE: Wall script

(03-08-2012, 12:20 PM)flamez3 Wrote: If you listened. I said only if the callbacks had 2 different function names. Screw it. Just give em the script and i'll fix it
But... there's just 1.... okay, whatever, here,
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "Prisonkey", "prisondoor", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddUseItemCallback("Hammer & Chipper", "cell_breakable_wall_1", "BreakWall", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prisondoor", false, true);
PlaySoundAtEntity("", "unlock_door", "prisondoor", 0, false);
RemoveItem("Prisonkey");
}
//Prison brute
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute", true);
AddEnemyPatrolNode("servant_brute", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_25", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_28", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_29", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_30", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_31", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_32", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_33", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_37", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_40", 0, "");
}
void Despawnservant_brute(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_brute", false);
}
//Cell wall
void OnStart()
{
AddUseItemCallback("", "stone_hammer_chipper", "cell_breakable_wall_1", "BreakWall", false);
}
void BreakWall(string &in asItem, string &in asEntity)
{
//SetSwingDoorLocked("cell_breakable_wall_1", false, true);
//PlaySoundAtEntity("", "unlock_door", "cell_breakable_wall_1", 0, false)
SetEntityActive("cell_breakable_wall_1", false);
SetEntityActive("cell_breakable_wall_broken_1", true);
}
void OnLeave()
{
}





03-08-2012, 12:36 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#44
RE: Wall script

You had two void OnStarts


void OnStart()
{
AddUseItemCallback("", "Prisonkey", "prisondoor", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddUseItemCallback("Hammer & Chipper", "cell_breakable_wall_1", "BreakWall", true);
AddUseItemCallback("", "stone_hammer_chipper", "cell_breakable_wall_1", "BreakWall", false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prisondoor", false, true);
PlaySoundAtEntity("", "unlock_door", "prisondoor", 0, false);
RemoveItem("Prisonkey");
}
//Prison brute
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute", true);
AddEnemyPatrolNode("servant_brute", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_25", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_28", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_29", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_30", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_31", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_32", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_33", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_37", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_40", 0, "");
}
void Despawnservant_brute(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_brute", false);
}

//Cell wall
void BreakWall(string &in asItem, string &in asEntity)
{
//SetSwingDoorLocked("cell_breakable_wall_1", false, true);
//PlaySoundAtEntity("", "unlock_door", "cell_breakable_wall_1", 0, false)
SetEntityActive("cell_breakable_wall_1", false);
SetEntityActive("cell_breakable_wall_broken_1", true);
}
void OnLeave()
{
}

And it might not work as I don't know which adduseitem callback you want to keep.

03-08-2012, 12:38 PM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#45
RE: Wall script

(03-08-2012, 12:38 PM)flamez3 Wrote: You had two void OnStarts


void OnStart()
{
AddUseItemCallback("", "Prisonkey", "prisondoor", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddUseItemCallback("Hammer & Chipper", "cell_breakable_wall_1", "BreakWall", true);
AddUseItemCallback("", "stone_hammer_chipper", "cell_breakable_wall_1", "BreakWall", false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prisondoor", false, true);
PlaySoundAtEntity("", "unlock_door", "prisondoor", 0, false);
RemoveItem("Prisonkey");
}
//Prison brute
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute", true);
AddEnemyPatrolNode("servant_brute", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_25", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_28", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_29", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_30", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_31", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_32", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_33", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_37", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_brute", "PathNodeArea_40", 0, "");
}
void Despawnservant_brute(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_brute", false);
}

//Cell wall
void BreakWall(string &in asItem, string &in asEntity)
{
//SetSwingDoorLocked("cell_breakable_wall_1", false, true);
//PlaySoundAtEntity("", "unlock_door", "cell_breakable_wall_1", 0, false)
SetEntityActive("cell_breakable_wall_1", false);
SetEntityActive("cell_breakable_wall_broken_1", true);
}
void OnLeave()
{
}

And it might not work as I don't know which adduseitem callback you want to keep.
The last 1 but yea, let's give it a go... xD
HOLY JESUS it worked... FINALLY!!!!!!!!! Omfg dude, I can't thank you enough for putting up with my stipidity for so long... lol


(This post was last modified: 03-08-2012, 06:23 PM by Saren.)
03-08-2012, 04:14 PM
Find




Users browsing this thread: 2 Guest(s)