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
Amnsesi script. need help
tokugawa1 Offline
Junior Member

Posts: 37
Threads: 8
Joined: Aug 2012
Reputation: 0
#1
Amnsesi script. need help

Well im creating a new map but im having trouble with the scripts so here is my .hps file:

void OnStart()
{
AddUseItemCallback("", "key_1", "door_1","UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0.0f, false);
RemoveItem("key_1");
}

{

SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);

}

void Spawn_Monster(string &in entity)
{

SetEntityActive("servant_brute_1", true);

}

void OnEnter()
{
}

And the error message says:



FATAL ERROR: Could not load script file 'custom_stories/The Deception/custom_stories/The Deception/maps/The Deception.hps'!

main (13,1) : ERR : Unexpected token '{'



Hope you guys can help me out [Image: sad.gif]
(This post was last modified: 08-01-2012, 07:22 PM by tokugawa1.)
08-01-2012, 07:21 PM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#2
RE: Amnsesi script. need help

try to place:

SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true); in void OnStart

CURRENT PROJECT:
A Fathers Secret == Just started
08-01-2012, 07:36 PM
Find
tokugawa1 Offline
Junior Member

Posts: 37
Threads: 8
Joined: Aug 2012
Reputation: 0
#3
RE: Amnsesi script. need help

(08-01-2012, 07:36 PM)ZereboO Wrote: try to place:

SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true); in void OnStart
like this?

void OnStart()
{
SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);

AddUseItemCallback("", "key_1", "door_1","UsedKeyOnDoor", true);
}
08-01-2012, 08:01 PM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#4
RE: Amnsesi script. need help

(08-01-2012, 08:01 PM)tokugawa1 Wrote:
(08-01-2012, 07:36 PM)ZereboO Wrote: like this?

void OnStart()
{
SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);

AddUseItemCallback("", "key_1", "door_1","UsedKeyOnDoor", true);
}
yes like that so to make it complete:
void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0.0f, false);
RemoveItem("key_1");
}

void Spawn_Monster(string &in entity)
{
SetEntityActive("servant_brute_1", true);
}

void OnEnter()
{

}

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
08-01-2012, 08:12 PM
Find
tokugawa1 Offline
Junior Member

Posts: 37
Threads: 8
Joined: Aug 2012
Reputation: 0
#5
RE: Amnsesi script. need help

(08-01-2012, 08:12 PM)Steve Wrote:
(08-01-2012, 08:01 PM)tokugawa1 Wrote:
(08-01-2012, 07:36 PM)ZereboO Wrote: like this?

void OnStart()
{
SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);

AddUseItemCallback("", "key_1", "door_1","UsedKeyOnDoor", true);
}
yes like that so to make it complete:
void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0.0f, false);
RemoveItem("key_1");
}

void Spawn_Monster(string &in entity)
{
SetEntityActive("servant_brute_1", true);
}

void OnEnter()
{

}
ok the CS works but when i try to use the key on the door it says "Cannot use this item this way!"
08-01-2012, 08:17 PM
Find
Lizard Offline
Member

Posts: 174
Threads: 23
Joined: Jul 2012
Reputation: 5
#6
RE: Amnsesi script. need help

make sure the entity names in the level editor and your .hps file is the same

CURRENT PROJECT:
A Fathers Secret == Just started
08-01-2012, 08:32 PM
Find
tokugawa1 Offline
Junior Member

Posts: 37
Threads: 8
Joined: Aug 2012
Reputation: 0
#7
RE: Amnsesi script. need help

(08-01-2012, 08:32 PM)ZereboO Wrote: make sure the entity names in the level editor and your .hps file is the same
yeah they are the same
i Also have another map and the keys work perfectly. so idk whats wrong with this one
(This post was last modified: 08-02-2012, 04:12 AM by tokugawa1.)
08-01-2012, 08:36 PM
Find
Seragath Offline
Junior Member

Posts: 34
Threads: 1
Joined: Jan 2011
Reputation: 0
#8
RE: Amnsesi script. need help

(08-01-2012, 08:36 PM)tokugawa1 Wrote: yeah they are the same
i Also have another map and the keys work perfectly. so idk whats wrong with this one


If you've used the exact same script previously and it worked then. You've must have gotten a name or function wrong.
08-02-2012, 02:44 PM
Find
tokugawa1 Offline
Junior Member

Posts: 37
Threads: 8
Joined: Aug 2012
Reputation: 0
#9
RE: Amnsesi script. need help

(08-02-2012, 02:44 PM)Seragath Wrote:
(08-01-2012, 08:36 PM)tokugawa1 Wrote: yeah they are the same
i Also have another map and the keys work perfectly. so idk whats wrong with this one


If you've used the exact same script previously and it worked then. You've must have gotten a name or function wrong.
well this map has 1 key and a monster that spawns after picking up a tinderbox, the other map has 3 keys so they arent the same but they both have keys
nvm fixed it
(This post was last modified: 08-02-2012, 06:38 PM by tokugawa1.)
08-02-2012, 03:44 PM
Find




Users browsing this thread: 3 Guest(s)