Frictional Games Forum (read-only)
7 scripting questions i need help with - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: 7 scripting questions i need help with (/thread-5395.html)



7 scripting questions i need help with - Gamemakingdude - 11-10-2010

I have 4-5 scripting questions. If you could guide me to what procs i should be looking at then i think i might be able to figure it out from there.

1. Sets say i have an area and it triggers an hanged prisoner to start moving around (like swaying) I want it to do either of the two things...
(a) To move to another place
(b) Start moving around (like a wind hitting it or something)

2. I want to make an collision event when a certain item hits an enemy (say a knife hitting one of the brutes) how would i do this?

3. I have an insanity area set up and i want a note to appear from above and it would fall to the ground (any ideas)

4. Is it possible to give preconfigured items (say agrippas head for example) and give them different names and description?

5. How does nodes work and how do i make them work for the enemies?

[EDIT]

6. Is it possible to pick up other items that aren't usually picked up (may be question for fritctionalgames.)

7. How do i add quests after reading a diary or trying a door?


RE: 7 scripting questions i need help with - Hooumeri - 11-10-2010

1. You could do this with the SetEntityActive, unless you want the movement to be continous (not from a to b).
One way to do that, is to use the
Code:
void  AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);
script

2. Just make it like you do with any other area, for example like this

Code:
void OnStart()
{
    AddEntityCollideCallback("Knife_01", "servant_grunt_01", "CollideKnifeHitsGrunt", true, 1);
}

CollideKnifeHitsGrunt(string &in asParent, string &in asChild, int alState)
{
      ///////Insert here the stuff you want to happen when the knife touches the grunt.
}

3. I have done similar with a corpse, just use the AddPropImpulse function (I'm not sure if this will work with notes, but technically it could)

4.I guess you could do it by making something like this to your lang file

Code:
    <CATEGORY Name="Inventory">
        <Entry Name="ItemName_AgrippaHead">/////Insert new name here</Entry>
        <Entry Name="ItemDesc_AgrippaHead">Insert new desc here</Entry>
                </CATEGORY>

5.Make a path by using pathnodes, starting from the enemy to where you want it to go. (notice that you might have to use a pathnode for every stair step for example) Then add a function like this to where you wish the patrol to start:

void AddEnemyPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation);
for example:

Code:
AddEnemyPatrolNode("servant_brute_01", "//////(insert here the last pathnode you inserted (the destination node, e.g:)PathNodeArea_14", 0, "");

6. You can make items objects (if that's what you meant) by using the model editor. I'm not 100% on how that works

7. Just insert a function like this:

void AddQuest(string& asName, string& asNameAndTextEntry);

for example:
Code:
AddQuest("questtest3","questtest3");

then make a text entry (the same name as in the script) to the lang file, like this:

<CATEGORY Name = "Journal">
<Entry Name="Quest_questtest3_Text">/////Insert the quest text here</Entry>
</CATEGORY>


RE: 7 scripting questions i need help with - Gamemakingdude - 11-10-2010

Thanks a lot!