(07-25-2011, 07:10 PM)zecuro Wrote: actually about note and key to open door and basic stuff like that i'm really new to this i have a lot of potentional in drawing so i came up with prettty good visual concept but without script......you cant really create a storyline so plz help
sorry for my bad english
For a custom story to run you need a .hps file with the same name as each map you have for your custom story. Meaning, for example, your map is called "MapName.map", then there will be a file in the same folder called "MapName.hps" that the modder has to make by themselves which then holds all the scripting information about that map.
This is needed for the most simple .hps script file to have the custom story successfully run the map:
To unlock a door with a key, you can do this:
void OnStart()
{
AddUseItemCallback("", "Key01", "Door01", "DoorUnlock", true);
}
void DoorUnlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
}
The code above unlocks swing doors (doors that the player can open with his hand). "Key01" is the name of the key that unlocks the door. "Door01" is the name of the door the key unlocks. "DoorUnlock" is the name of the function where once it's called unlocks the door, which is the entity. It plays the sound at the door. And it removes the key that unlocks the door.