Frictional Games Forum (read-only)
[SCRIPT] Please help - 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] Please help (/thread-21297.html)

Pages: 1 2


Please help - mitkovarn - 04-27-2013

Look at these pictures and tell me where is the wrong at the script (the script is for headless agripe (unactive) to appear when the player walk into the script area if you have ideas please help
Link1---->http://postimg.org/image/uj1u820mj/ (the error)
Link2---->http://postimg.org/image/qokwvc4dt/ (my sccript file)


RE: Please help - OriginalUsername - 04-27-2013

You have to put the addentitycollidecallback in the OnStart section.

[Image: images?q=tbn:ANd9GcSVYSnOi8NlsD7QNJoz2Do..._sypqpjQ8Q]


RE: Please help - ClayPigeon - 04-27-2013

You have a function that is outside any callback.
Put AddEntityCollideCallback("Player", "ScriptArea_1", "NailThatSucker", true, 1); under OnStart().


RE: Please help - mitkovarn - 04-27-2013

////////////////////////////
// Run first time starting map
void OnStart()
AddEntityCollideCallback("Player", "ScriptArea_1", "NailThatSucker", true, 1);
{
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
}

void NailTheSucker(sting &in asParent, string &in asChild, int alStates)
{
SetEntityActive("agrippa_headless_1", true);
AddPropForce("agrippa_headless_1", 0, 0, 0, world);
PlaySoundAtEntity("", "24_iron_maiden.snt", "agrippa_headless_1", 0, false);
}




somethink like this?
(still giving error even 2 errors)


RE: Please help - OriginalUsername - 04-27-2013

(04-27-2013, 06:19 PM)mitkovarn Wrote: ////////////////////////////
// Run first time starting map
void OnStart()
AddEntityCollideCallback("Player", "ScriptArea_1", "NailThatSucker", true, 1);
{
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
}

void NailTheSucker(sting &in asParent, string &in asChild, int alStates)
{
SetEntityActive("agrippa_headless_1", true);
AddPropForce("agrippa_headless_1", 0, 0, 0, world);
PlaySoundAtEntity("", "24_iron_maiden.snt", "agrippa_headless_1", 0, false);
}




somethink like this?
(still giving error even 2 errors)

No, inside the brackets:

Code:
void OnStart()
{
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "NailThatSucker", true, 1);
}



RE: Please help - mitkovarn - 04-27-2013

http://postimg.org/image/5iugezp9j/ 3 errors


RE: Please help - OriginalUsername - 04-27-2013

(04-27-2013, 06:27 PM)mitkovarn Wrote: http://postimg.org/image/5iugezp9j/ 3 errors

When a error says main(15,20), the computer means there is something wrong in the 15th line, the 20th symbol. So you see: 'sting' is not a data type, so sting is nothing and it should be string.
when 'world' is not declared, it should be between "".
That should do it..I hope

Tip: I wouldn't type everything, just copy paste everything is a good way to prevent typos


RE: Please help - mitkovarn - 04-27-2013

ty now the map is running but for what was all that writing the script wont work :X

so i am at the script and nothing is happening why?


RE: Please help - OriginalUsername - 04-27-2013

(04-27-2013, 06:45 PM)mitkovarn Wrote: ty now the map is running but for what was all that writing the script wont work :X

so i am at the script and nothing is happening why?

Make sure all the names in-game are right. So the door is called 'door' (Or anything you like) They just have to match in the editor and your script file.


RE: Please help - mitkovarn - 04-27-2013

i mean the script for the agripa is not working the script for the key and door is okey but the agripa's script wont work

if you want i will send you my map its 60kb

and yes the names are matching