(12-13-2010, 03:43 PM)Akumasama Wrote: Well, to start out, try writing it yourself.
We will be glad to help you fix it.
If you just started with scripting, take a look at other scripts to see the structure.
For example, this is how I started: http://frictionalgames.com/forum/thread-5425.html
Okay heres one question: Where i put all scripts because there are 3 areas?
OnStart() What scripts belongs here?
OnEnter() here?
OnLeave() here?
Im confused because i tried OnStart my 3 scripts put but there are couple errors. end of file.. example:
And how i seperate all void codes..
Okay this one is working script: Two doors with open keys.. I get it but.. where i put now Enemy trigger script area?
void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_2", "door_2", "KeyOnDoor2", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, false);
RemoveItem("key_1");
AddDebugMessage("KeyOnDoor", false);
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}