Frictional Games Forum (read-only)

Full Version: Amnsesi script. need help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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]
try to place:

SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true); in void OnStart
(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)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()
{

}
(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!"
make sure the entity names in the level editor and your .hps file is the same
(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
(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)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