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 Tell Me The Wrong??...
Jayvee17 Offline
Junior Member

Posts: 25
Threads: 6
Joined: May 2011
Reputation: 0
#1
Question  Can Someone Tell Me The Wrong??...

What Is Wrong In This .hps?? Huh

////////////////////////////
// Run first time starting map
void OnStart()
{
FadeIn(3);
SetPlayerActive(true);
ShowPlayerCrossHairIcons(true);
SetInventoryDisabled(false);
SetPlayerJumpDisabled(false);
SetPlayerCrouchDisabled(false);
AddUseItemCallback("", "Door_1_Key", "Door_1", "UsedKeyOnDoor_01", true);
AddUseItemCallback("", "Door_3_Key", "Door_3", "UsedKeyOnDoor_02", true);

{
SetSwingDoorLocked("Door_3", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_3", 0, false);
RemoveItem("Door_3_Key");
}

void UsedKeyOnDoor_03(string &in asItem, string &in asEntity)
}

SetSwingDoorLocked("Door_Of_Freedom", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_Of_Freedom", 0, false);
RemoveItem("Key_Of_Freedom");
}

void UsedKeyOnDoor_Of_Freedom(string &in asItem, string &in asEntity)
{
GiveItemFromFile("lantern", "lantern.ent");
}
{
SetEntityPlayerInteractCallback("Key_Of_Freedom", "Func01", true);
}
void Func01(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
}
05-31-2011, 01:03 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Can Someone Tell Me The Wrong??...

Many things are wrong.

Basic script structure is like this:

void FunctionName ( function variable 1, function variable 2...)
{
What to do 1;
What to do 2;
....
}

So, you have many
{
What to do 1;
What to do 2;
....
}
parts that doesn't have
void FunctionName ( function variable 1, function variable 2...)
parts.

(This post was last modified: 05-31-2011, 01:11 PM by Tanshaydar.)
05-31-2011, 01:10 PM
Website Find
Jayvee17 Offline
Junior Member

Posts: 25
Threads: 6
Joined: May 2011
Reputation: 0
#3
RE: Can Someone Tell Me The Wrong??...

Can You Explain It Clearly Please..??
I Change My Code To:

////////////////////////////
// Run first time starting map
void OnStart()
{
FadeIn(3);
SetPlayerActive(true);
ShowPlayerCrossHairIcons(true);
SetInventoryDisabled(false);
SetPlayerJumpDisabled(false);
SetPlayerCrouchDisabled(false);
AddUseItemCallback("", "Door_3_Key", "Door_3", "UsedKeyOnDoor_03", true);
AddUseItemCallback("", "Key_Of_Freedom", "Door_Of_Freedom", "UsedKeyOnDoor_Of_Freedom", true);

SetSwingDoorLocked("Door_3", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_3", 0, false);
RemoveItem("Door_3_Key");

void UsedKeyOnDoor_03(string &in asItem, string &in asEntity)

SetSwingDoorLocked("Door_Of_Freedom", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_Of_Freedom", 0, false);
RemoveItem("Key_Of_Freedom");

void UsedKeyOnDoor_Of_Freedom(string &in asItem, string &in asEntity)

GiveItemFromFile("lantern", "lantern.ent");
SetEntityPlayerInteractCallback("Key_Of_Freedom", "Func01", true);

void Func01(string &in asEntity)

SetEntityActive("servant_grunt_1", true);
}
(05-31-2011, 01:44 PM)Jayvee17 Wrote: Can You Explain It Clearly Please..??
I Change My Code To:

////////////////////////////
// Run first time starting map
void OnStart()
{
FadeIn(3);
SetPlayerActive(true);
ShowPlayerCrossHairIcons(true);
SetInventoryDisabled(false);
SetPlayerJumpDisabled(false);
SetPlayerCrouchDisabled(false);
AddUseItemCallback("", "Door_3_Key", "Door_3", "UsedKeyOnDoor_03", true);
AddUseItemCallback("", "Key_Of_Freedom", "Door_Of_Freedom", "UsedKeyOnDoor_Of_Freedom", true);

SetSwingDoorLocked("Door_3", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_3", 0, false);
RemoveItem("Door_3_Key");

void UsedKeyOnDoor_03(string &in asItem, string &in asEntity)

SetSwingDoorLocked("Door_Of_Freedom", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_Of_Freedom", 0, false);
RemoveItem("Key_Of_Freedom");

void UsedKeyOnDoor_Of_Freedom(string &in asItem, string &in asEntity)

GiveItemFromFile("lantern", "lantern.ent");
SetEntityPlayerInteractCallback("Key_Of_Freedom", "Func01", true);

void Func01(string &in asEntity)

SetEntityActive("servant_grunt_1", true);
}

When I Try This One It Says:
FATAL ERROR:Could not load script file 'custom_stories/The House/maps/TheHouse.hps'!
main (18, 30) : ERR :Expected '('
main (24, 38) : ERR :Expected '('
main (29, 20) : ERR :Expected '('
(This post was last modified: 05-31-2011, 01:56 PM by Jayvee17.)
05-31-2011, 01:44 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#4
RE: Can Someone Tell Me The Wrong??...

////////////////////////////
// Run first time starting map
void OnStart()
{
FadeIn(3);
SetPlayerActive(true);
ShowPlayerCrossHairIcons(true);
SetInventoryDisabled(false);
SetPlayerJumpDisabled(false);
SetPlayerCrouchDisabled(false);
AddUseItemCallback("", "Door_3_Key", "Door_3", "UsedKeyOnDoor_03", true);
AddUseItemCallback("", "Key_Of_Freedom", "Door_Of_Freedom", "UsedKeyOnDoor_Of_Freedom", true);
}
The part below supposed to be a function? Or inside OnStart?
{
SetSwingDoorLocked("Door_3", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_3", 0, false);
RemoveItem("Door_3_Key");
}
void UsedKeyOnDoor_03(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_Of_Freedom", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_Of_Freedom", 0, false);
RemoveItem("Key_Of_Freedom");
}
void UsedKeyOnDoor_Of_Freedom(string &in asItem, string &in asEntity)
{
GiveItemFromFile("lantern", "lantern.ent");
SetEntityPlayerInteractCallback("Key_Of_Freedom", "Func01", true);
}
void Func01(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
}

05-31-2011, 02:19 PM
Website Find
Jayvee17 Offline
Junior Member

Posts: 25
Threads: 6
Joined: May 2011
Reputation: 0
#5
RE: Can Someone Tell Me The Wrong??...

Not Yet Working...It Says...
FATAL ERROR:Could not load script file 'custom_stories/The House/maps/TheHouse.hps'!
main (15, 1) : ERR :Unexpected token '{'
05-31-2011, 02:54 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#6
RE: Can Someone Tell Me The Wrong??...

Did you actually read what I wrote or just copied it?

05-31-2011, 03:04 PM
Website Find
Jayvee17 Offline
Junior Member

Posts: 25
Threads: 6
Joined: May 2011
Reputation: 0
#7
RE: Can Someone Tell Me The Wrong??...

What Do You Mean???....Can You Make The Correct Codes Please...???
05-31-2011, 03:25 PM
Find
iVicio Offline
Junior Member

Posts: 4
Threads: 1
Joined: Sep 2010
Reputation: 0
#8
RE: Can Someone Tell Me The Wrong??...

////////////////////////////
// Run first time starting map
void OnStart()
{
FadeIn(3);
SetPlayerActive(true);
ShowPlayerCrossHairIcons(true);
SetInventoryDisabled(false);
SetPlayerJumpDisabled(false);
SetPlayerCrouchDisabled(false);
AddUseItemCallback("", "Door_3_Key", "Door_3", "UsedKeyOnDoor_03", true);
AddUseItemCallback("", "Key_Of_Freedom", "Door_Of_Freedom", "UsedKeyOnDoor_Of_Freedom", true);
}

void UsedKeyOnDoor_03(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_3", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_3", 0, false);
RemoveItem("Door_3_Key");
}
void UsedKeyOnDoor_Of_Freedom(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_Of_Freedom", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_Of_Freedom", 0, false);
RemoveItem("Key_Of_Freedom");
}

(This post was last modified: 05-31-2011, 08:22 PM by iVicio.)
05-31-2011, 08:19 PM
Website Find
laser50 Offline
Member

Posts: 242
Threads: 22
Joined: Apr 2011
Reputation: 0
#9
RE: Can Someone Tell Me The Wrong??...

I have nothing against helping but i think that IF people want help, that they should not simply copy/paste, learn nothing and ask again later...

Jayvee17, Look at the code, learn from it. Follow some tutorials.
05-31-2011, 08:21 PM
Find
Jayvee17 Offline
Junior Member

Posts: 25
Threads: 6
Joined: May 2011
Reputation: 0
#10
RE: Can Someone Tell Me The Wrong??...

Ok Thanks Dude!!
It's Now Working but the intro and ending is not working...
My Intro.hps is here:
void OnStart()
{
AddTimer("", 0.5f, "Intro");
SetPlayerActive(false);
ShowPlayerCrossHairIcons(false);
SetInventoryDisabled(true);
SetPlayerJumpDisabled(true);
SetPlayerCrouchDisabled(true);
}

void Intro(string &in asTimer)
{
SetMessage("TheHouse", "Intro", 20.0f);
AddTimer("", 21.0f, "NextMap");
}

void NextMap(string &in asTimer)
{
ChangeMap("The_House", "PlayerStartArea_1", "", "");
}



And My Ending Is Here:

void OnStart()
{
AddTimer("", 0.5f, "Outro");
SetPlayerActive(false);
ShowPlayerCrossHairIcons(false);
SetInventoryDisabled(true);
SetPlayerJumpDisabled(true);
SetPlayerCrouchDisabled(true);
}

void Outro(string &in asTimer)
{
StartCredits("", false, "Ending", "Credits", 1);
}




If You Want To See My extra_english.lang, it is here:
<LANGUAGE>

<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">The House...[br][br]You Discover This House In The Middle Of A Forest...[br]After Getting Inside The House, You Can't Get Out Anymore.[br]You Need To Find The Key To Get Out.</Entry>
</CATEGORY>

<CATEGORY Name="Inventory">
<Entry Name="ItemName_Door_3_Key">Door 3 Key</Entry>
<Entry Name="ItemDesc_Door_3_Key">Well Rusty Key Of Door 3</Entry>
<Entry Name="ItemName_Key_Of_Freedom">Key Of Freedom</Entry>
<Entry Name="ItemDesc_Key_Of_Freedom">Use To Open The Door Of Freedom.</Entry>
</CATEGORY>

<CATEGORY Name="Journal">
<Entry Name="Note_The_House_Note_Name">The House Note</Entry>
<Entry Name="Note_The_House_Note_Text">This House Is Said To Be A Home Of Some Types Of Aliens.</Entry>
<Entry Name="Note_Key_Of_Freedom_Clue_Name">The Key Of Freedom</Entry>
<Entry Name="Note_Key_Of_Freedom_Clue_Text">The Key Is Under The Stairs...Beware Of Aliens...</Entry>
</CATEGORY>

<CATEGORY Name="Messages">
<Entry Name="DoorLocked">The door is locked...</Entry>
</CATEGORY>

<CATEGORY Name="TheHouse">
<Entry Name="Intro">While I Was Camping In A Forest, I Saw A Little House.[br]I Go Inside The House To Rest...[br]As I Try To Go Out, I Can't Get Out Anymore[br]I Need To Find The Key To Get Out...</Entry>
<Entry Name="Arrival">Hello??...[br]Somebody Here??...[br]Someone Help Me...!!</Entry>
</CATEGORY>

<CATEGORY Name="Ending">
<Entry Name="Credits">The House...[br][br]This Only The Part 1...[br][br][br]Special Thanks To Frictional Games[br][br][br]And To You For Playing...!!</Entry>
</CATEGORY>

</LANGUAGE>



What's The Problem??
(This post was last modified: 06-01-2011, 06:30 AM by Jayvee17.)
06-01-2011, 06:20 AM
Find




Users browsing this thread: 1 Guest(s)