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
New Key Problems
ryan1431 Offline
Junior Member

Posts: 14
Threads: 10
Joined: Dec 2012
Reputation: 0
#1
New Key Problems

Small new problem which will solve a lot of stress...

For every new key do i need a new ".hps" file? Because i tried adding the new key data underneath
with these commands, (this is what is in total)

void OnStart()
{
AddUseItemCallback("", "studykey_1", "mansion_2", "OPEN", true);
}

void OPEN(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0, false);
RemoveItem("studykey_1");
}

void StudyDoorLocked(string &in entity)


{
if(GetSwingDoorLocked("mansion_2") == true)
{

SetMessage("Messages", "studyroomlocked", 0);

}
}



AddUseItemCallback("", "dungeonkey_2", "mansion_3", "OPEN", true);


void OPEN(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem("dungeonkey_2");
}

void DungeonDoorLocked(string &in entity)


{
if(GetSwingDoorLocked("mansion_") == true)
{

SetMessage("Messages", "dungeondoorlocked", 0);

}
}

and it says this,

Main (27,19) : ERR : Expected Identifier

(thats the line that looks like this "AddUseItemCallback("", "dungeonkey_2", "mansion_3", "OPEN", true);"

I tried putting {, and }, around it but it told me to get rid of them...

please help
12-02-2012, 01:52 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: New Key Problems

void OnStart()
{
AddUseItemCallback("", "studykey_1", "mansion_2", "OPEN", true);AddUseItemCallback("", "dungeonkey_2", "mansion_3", "OPEN_somethingelse", true);
}

void OPEN(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0, false);
RemoveItem("studykey_1");
}

void StudyDoorLocked(string &in entity)


{
if(GetSwingDoorLocked("mansion_2") == true)
{

SetMessage("Messages", "studyroomlocked", 0);

}
}

void OPEN(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem("dungeonkey_2");
}

void DungeonDoorLocked(string &in entity)


{
if(GetSwingDoorLocked("mansion_") == true)
{

SetMessage("Messages", "dungeondoorlocked", 0);

}
}


No, you don't need a new .hps file for every single script. Wrong section to post this too.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-02-2012, 02:02 AM
Find
ryan1431 Offline
Junior Member

Posts: 14
Threads: 10
Joined: Dec 2012
Reputation: 0
#3
RE: New Key Problems

(12-02-2012, 02:02 AM)The chaser Wrote:
void OnStart()
{
AddUseItemCallback("", "studykey_1", "mansion_2", "OPEN", true);AddUseItemCallback("", "dungeonkey_2", "mansion_3", "OPEN_somethingelse", true);
}

void OPEN(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0, false);
RemoveItem("studykey_1");
}

void StudyDoorLocked(string &in entity)


{
if(GetSwingDoorLocked("mansion_2") == true)
{

SetMessage("Messages", "studyroomlocked", 0);

}
}

void OPEN(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem("dungeonkey_2");
}

void DungeonDoorLocked(string &in entity)


{
if(GetSwingDoorLocked("mansion_") == true)
{

SetMessage("Messages", "dungeondoorlocked", 0);

}
}


No, you don't need a new .hps file for every single script. Wrong section to post this too.

do i actually say OPEN_(then the words)"somethingelse"?
12-02-2012, 02:07 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: New Key Problems

AddUseItemCallback("", "dungeonkey_2", "mansion_3", "OPEN_somethingelse", true);


void OPEN_somethingelse(string &in asItem, string &in asEntity)
{
/////Door thing, uses keys, removes key, opens door, etc
}


You can check scripts in simple stories. There you'll see a lot of things.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-02-2012, 11:23 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: New Key Problems

Learn to use parameters, and you could use the same function for all key-door use-item callbacks.

Tutorials: From Noob to Pro
12-02-2012, 11:17 PM
Website Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#6
RE: New Key Problems

This thread shows what parameters are. Very good explanation.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-03-2012, 09:29 AM
Find




Users browsing this thread: 2 Guest(s)