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
#11
RE: Wall script

(03-06-2012, 03:01 PM)flamez3 Wrote: Use this:


// 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);
}

void BreakWall("Hammer & Chipper" , "cell_breakable_wall_1")
{
SetSwingDoorLocked("cell_breakable_wall_1", false, true);
PlaySoundAtEntity("", "unlock_door", "cell_breakable_wall_1", 0, false);
SetEntityActive("cell_breakable_wall_1", false);
}
Hmmm... new error I've never seen before... intresting
main (67,16) ERR: Expected data type



03-06-2012, 03:14 PM
Find
flamez3 Offline
Posting Freak

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

Do not write over syntax's. Sorry if it's taking a while. I was only looking at the error you gave me:


// 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);
}

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);
}

03-06-2012, 03:30 PM
Find
Saren Offline
Member

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

(03-06-2012, 03:30 PM)flamez3 Wrote: Do not write over syntax's. Sorry if it's taking a while. I was only looking at the error you gave me:


// 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);
}

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);
}
It's cool bro, quite fun actually... xD
Oh, and here's the new error
No matching signatures for AddUseItemCallback(string@&, string@&,, const bool)


(This post was last modified: 03-06-2012, 04:12 PM by Saren.)
03-06-2012, 03:38 PM
Find
Saren Offline
Member

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

I'm Doomed.. if flamez can't fix it... not even god can fix it...

03-06-2012, 11:17 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#15
RE: Wall script

Study: http://wiki.frictionalgames.com/hpl2/amn...#inventory

Tutorials: From Noob to Pro
03-07-2012, 12:05 AM
Website Find
Saren Offline
Member

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

(03-07-2012, 12:05 AM)Your Computer Wrote: Study: http://wiki.frictionalgames.com/hpl2/amn...#inventory
What did I just say?????... Nvm... I'll try.... Not gonna happen though.... but I'll try... hopelessly... yup... it's what I dooo



03-07-2012, 12:12 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#17
RE: Wall script

(03-07-2012, 12:12 AM)Saren Wrote: What did I just say?????... Nvm... I'll try.... Not gonna happen though.... but I'll try... hopelessly... yup... it's what I dooo

You don't know how to use the AddUseItemCallback function, hence study.

Tutorials: From Noob to Pro
03-07-2012, 12:27 AM
Website Find
flamez3 Offline
Posting Freak

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

Sorry bro I went to bed and haven't checked this thread till now ;D

03-07-2012, 02:34 AM
Find
Saren Offline
Member

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

(03-07-2012, 02:34 AM)flamez3 Wrote: Sorry bro I went to bed and haven't checked this thread till now ;D
Lol fair enough... Just went on trying to get this stupid thing working.. >_<



(03-07-2012, 12:27 AM)Your Computer Wrote:
(03-07-2012, 12:12 AM)Saren Wrote: What did I just say?????... Nvm... I'll try.... Not gonna happen though.... but I'll try... hopelessly... yup... it's what I dooo

You don't know how to use the AddUseItemCallback function, hence study.
I don't huh, would'nt
AddUseItemCallback("Hammer & Chipper", "cell_breakable_wall_1", "BreakWall", true);
THAT work!?



(This post was last modified: 03-07-2012, 07:54 AM by Saren.)
03-07-2012, 07:52 AM
Find
flamez3 Offline
Posting Freak

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

No. If you read it you would find out there are 5 parameters to meet:

asName - internal name
asItem - internal name of the item
asEntity - entity to be able to use the item on
asFunction - function to call
abAutoDestroy - determines whether the item is destroyed when used


Which comes to:

AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);

03-07-2012, 08:29 AM
Find




Users browsing this thread: 1 Guest(s)