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
Hpl 2 help
s2skafte Offline
Junior Member

Posts: 7
Threads: 2
Joined: Mar 2013
Reputation: 0
#11
RE: Hpl 2 help

(03-25-2013, 01:53 AM)Your Computer Wrote: SetSwingDoorClosed is missing a closing quotation in Collideroomtwo.

not sure what you meant there but i got a new problem.
this is a new script for te next map and i get that error 14,1 unexpected token '{'


void Onstart()
{
AddUseItemCallback("", "key_tower_2", "Lockeddoor_3", "hello3", true);
SetEntityCallbackFunc("key_tower_2", "OnPickup");

}

void hello3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_Lockeddoor_3", asEntity, 0, false);
RemoveItem(asItem);
}
{
SetEntityActive("Monster_grunt_1", true);
ShowEnemyPlayerPosition("Monster_grunt_1");
}
03-25-2013, 05:44 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#12
RE: Hpl 2 help

1. Should be OnStart, not Onstart (you need a capital 'S')

2. These two lines
SetEntityActive("Monster_grunt_1", true);
ShowEnemyPlayerPosition("Monster_grunt_1");
need to be inside a function.

3. You wrote OnPickup for the callback for SetEntityCallbackFunc, but you didn't put that function anywhere. I'm assuming that you want those two lines (above) to happen when the player picks up the key?

Try using this script.
PHP Code: (Select All)
void OnStart()
{
    
AddUseItemCallback("""key_tower_2""Lockeddoor_3""hello3"true);
    
SetEntityPlayerInteractCallback("key_tower_2""OnKeyPickup"true);

}

void hello3(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked(asEntityfalsetrue);
    
PlaySoundAtEntity("""unlock_Lockeddoor_3"asEntity0false);
    
RemoveItem(asItem);
}

void OnKeyPickup(string &in asEntity)
{
    
SetEntityActive("Monster_grunt_1"true);
    
ShowEnemyPlayerPosition("Monster_grunt_1");


In Ruins [WIP]
03-25-2013, 06:49 PM
Find
s2skafte Offline
Junior Member

Posts: 7
Threads: 2
Joined: Mar 2013
Reputation: 0
#13
RE: Hpl 2 help

Thanks i will update this thread if i run into any more problems.
if anybody coud help me out with the other script that would be great.
03-25-2013, 09:34 PM
Find
s2skafte Offline
Junior Member

Posts: 7
Threads: 2
Joined: Mar 2013
Reputation: 0
#14
RE: Hpl 2 help

i have got another problem unexpected token 21,1 '{'

New script for new map

void OnStart()
{
AddEntityCollideCallback("Player", "push", "Push", true, 1);
AddEntityCollideCallback("Player", "door_slam", "Slam", true, 1);
}


void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
AddPlayerBodyForce(-300000, 0, 0, false);
}


void Slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("cellar_1", true, true);
SetSwingDoorLocked("cellar_1", true, true);
PlaySoundAtEntity("", "break_wood.snt", "door_scare", 0, false);
}
{

AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
}
03-25-2013, 11:33 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#15
RE: Hpl 2 help

void OnStart()

{

AddEntityCollideCallback("Player", "push", "Push", true, 1);

AddEntityCollideCallback("Player", "door_slam", "Slam", true, 1);AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}


void Push(string &in asParent, string &in asChild, int alState)

{

PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);

AddPlayerBodyForce(-300000, 0, 0, false);

}


void Slam(string &in asParent, string &in asChild, int alState)

{

SetSwingDoorClosed("cellar_1", true, true);

SetSwingDoorLocked("cellar_1", true, true);

PlaySoundAtEntity("", "break_wood.snt", "door_scare", 0, false);

}

void MonsterFunction(string &in asParent, string &in asChild, int alState)

{

SetEntityActive("servant_grunt_1", true);

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

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

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

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

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

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

}

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-26-2013, 06:30 AM
Find




Users browsing this thread: 1 Guest(s)