Frictional Games Forum (read-only)
Script order? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Script order? (/thread-20690.html)

Pages: 1 2


RE: Script order? - No Author - 03-10-2013

I can't help you until I understand the script. Or at least tell us what you want to do with the script.

(03-10-2013, 11:44 AM)ZereboO Wrote: Try do it like this.
PHP Code:
void OnStart()
{
AddEntityCollideCallback("player" "Scriptarea_1" "FunctionName" true 1);
AddUseItemCallback("""key_2""EXAMPLE_DOOR""FUNCTION"true);
}

void FUNCTION(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity("""unlock_door"asEntity0false);
RemoveItem(asItem);
AddEntityCollideCallback("Player""Message_1""Message1"true1);


void FunctionName(string &in asParent string &in asChild int alState)
{
PlaySoundAtEntity("""unlock_door""Scriptarea_1"0false);
}

void Message1(string &in asChildstring &in asParentint alState)
{
SetMessage("Messages""Popup4"6); //This stands for ("Name of category", "Name of entry", time to be displayed on the screen);
}

void OnLeave()
{



Not sure if he wants the script to be like that. But a real script looks like this.


RE: Script order? - mrsomeepicrandomguy - 03-10-2013

(03-10-2013, 11:49 AM)No Author Wrote: I can't help you until I understand the script. Or at least tell us what you want to do with the script.

(03-10-2013, 11:44 AM)ZereboO Wrote: Try do it like this.
PHP Code:
void OnStart()
{
AddEntityCollideCallback("player" "Scriptarea_1" "FunctionName" true 1);
AddUseItemCallback("""key_2""EXAMPLE_DOOR""FUNCTION"true);
}

void FUNCTION(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity("""unlock_door"asEntity0false);
RemoveItem(asItem);
AddEntityCollideCallback("Player""Message_1""Message1"true1);


void FunctionName(string &in asParent string &in asChild int alState)
{
PlaySoundAtEntity("""unlock_door""Scriptarea_1"0false);
}

void Message1(string &in asChildstring &in asParentint alState)
{
SetMessage("Messages""Popup4"6); //This stands for ("Name of category", "Name of entry", time to be displayed on the screen);
}

void OnLeave()
{



Not sure if he wants the script to be like that. But a real script looks like this.
I Fuc**d up! Thank you for the help!
{
AddEntityCollideCallback("player" , "Scriptarea_1" , "FunctionName" , true , 1);
AddUseItemCallback("", "key_2", "EXAMPLE_DOOR", "FUNCTION", true);
}
It should be like that, i have that on the other maps.. im a retard: thank you!