Frictional Games Forum (read-only)
Help With Scripting Please :D - 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: Help With Scripting Please :D (/thread-25696.html)

Pages: 1 2


Help With Scripting Please :D - Aglowglint11 - 07-15-2014

So, I've posted a couple threads on here before but I can never get my scripting down no matter how hard I try. And I was wondering if any of you guys could help me with it?

What I wanted to do is simple, but obviously too complicated for me (lol) I just wanted to make it so pass in a certain Area it De-Activates Two Particle systems, but you also need to get three peices of a drill to open a Door, then I also have a hidden key, Like if anyone could help me I'd be very glad. :D (I'm very bad at blending scripts like these)


RE: Help With Scripting Please :D - DnALANGE - 07-15-2014

Let me try to explane thing by thing.

1:I just wanted to make it so pass in a certain Area it De-Activates Two Particle systems.
Here is how that goes:
Make a scriptarea in your leveleditor called : DeleteParticleHallway
Then open your HPS ( script ) add this code OnStart()
PHP Code:
AddEntityCollideCallback("Player""DeleteParticleHallway ""JustRemoveParticlesHallway"true1); 
Then make a scriptfunction like this
PHP Code:
void JustRemoveParticlesHallway(string &in asParentstring &in asChildint alState)
{
DestroyParticleSystem("ParticleSystem_190");//The name of a particle in your leveleditor
DestroyParticleSystem("ParticleSystem_191");//The name of the seconth particle in your leveleditor
That should do the trick for destroying the particles

---
For the next thing for the drillparts you need to have a file called INVENTORY.HPS
You can find this file in Amnesia\Redist\maps\main (inventory.hps)
Copy that in YOUR maps folder of YOUR story.
That should do the trick for the 3 pieces.
Altho you will need to RENAME the pieces witch are named in the INVENTORY.HPS.
Here is how to add the scripts:
THESE below are the scripts you will find in the Inventory.hps() You do NOT need to place this in YOUR scriptfile, the Inventory will find these pieces!
PHP Code:
    AddCombineCallback("drill_1_2""hand_drill_part01","hand_drill_part02""CombineDrill"false);

    
AddCombineCallback("drill_1_3""hand_drill_part01""hand_drill_part03""CombineDrill"false);

    
AddCombineCallback("drill_2_3""hand_drill_part02""hand_drill_part03""CombineDrill"false); 
Then add the names -> hand_drill_part01 --- hand_drill_part02 --- hand_drill_part03 ON the 3 items (seperate offcourse) in your leveleditor.
---
What do you mean with this: then I also have a hidden key???


RE: Help With Scripting Please :D - Aglowglint11 - 07-15-2014

It gave me an error when I tried to use the script, It comes out as this:

Main(1,1):ERR : Identifier 'Void' is not a valid data type
Main(1,1):ERR : Identifier 'Void' is not a valid data type
Main(4,6):ERR : Expected '('


RE: Help With Scripting Please :D - DnALANGE - 07-15-2014

Copy past your scipt here please
Do it like in a spoiler please
Like i do here
Spoiler below!
Tekst what you want here here
Spoilers are made like this : [*spoiler] tekst what you want here [/*spoiler]
Remove the * from both spoilers.


RE: Help With Scripting Please :D - Aglowglint11 - 07-15-2014

(07-15-2014, 01:23 PM)DnALANGE Wrote: Copy past your scipt here please
Do it like in a spoiler please
Like i do here
Spoiler below!
Tekst what you want here here
Spoilers are made like this : [*spoiler] tekst what you want here [/*spoiler]
Remove the * from both spoilers.

[spoiler] Void OnStart()
{
AddEntityCollideCallback("Player", "DeleteParticleHallway ", "JustRemoveParticlesHallway", true, 1);
void JustRemoveParticlesHallway(string &in asParent, string &in asChild, int alState)
AddCombineCallback("drill_1_2", "hand_drill_part01", "hand_drill_part02", "CombineDrill", false);
AddCombineCallback("drill_1_3", "hand_drill_part01", "hand_drill_part03", "CombineDrill", false);
AddCombineCallback("drill_2_3", "hand_drill_part02", "hand_drill_part03", "CombineDrill", false);
{
DestroyParticleSystem("ParticleSystem_190");//The name of a particle in your leveleditor
DestroyParticleSystem("ParticleSystem_191");//The name of the seconth particle in your leveleditor
That should do the trick for destroying the particles
}
} [spoiler]

Figured I was doing something wrong. Lol.


RE: Help With Scripting Please :D - DnALANGE - 07-15-2014

the last spoiler must have a /spoiler

THIS :
PHP Code:
void JustRemoveParticlesHallway(string &in asParentstring &in asChildint alState)
{
DestroyParticleSystem("ParticleSystem_190");//The name of a particle in your leveleditor
DestroyParticleSystem("ParticleSystem_191");//The name of the seconth particle in your leveleditor
That should do the trick for destroying the particles

Must NOT inside OnStart.
THis is a function itself.
ALWAYS REMEMBER, void *** can NOT be in OnStart \ OnEnter \ OnLeave


RE: Help With Scripting Please :D - Aglowglint11 - 07-15-2014

(07-15-2014, 01:27 PM)DnALANGE Wrote: the last spoiler must have a /spoiler

Oh Lol.

Spoiler below!


Void OnStart()
{
AddEntityCollideCallback("Player", "DeleteParticleHallway ", "JustRemoveParticlesHallway", true, 1);
void JustRemoveParticlesHallway(string &in asParent, string &in asChild, int alState)
AddCombineCallback("drill_1_2", "hand_drill_part01", "hand_drill_part02", "CombineDrill", false);
AddCombineCallback("drill_1_3", "hand_drill_part01", "hand_drill_part03", "CombineDrill", false);
AddCombineCallback("drill_2_3", "hand_drill_part02", "hand_drill_part03", "CombineDrill", false);
{
DestroyParticleSystem("ParticleSystem_190");//The name of a particle in your leveleditor
DestroyParticleSystem("ParticleSystem_191");//The name of the seconth particle in your leveleditor
That should do the trick for destroying the particles
}
}





RE: Help With Scripting Please :D - DnALANGE - 07-15-2014

These : AddCombineCallback("drill_1_2", "hand_drill_part01", "hand_drill_part02", "CombineDrill", false);
AddCombineCallback("drill_1_3", "hand_drill_part01", "hand_drill_part03", "CombineDrill", false);
AddCombineCallback("drill_2_3", "hand_drill_part02", "hand_drill_part03", "CombineDrill", false);
You do NOT need the above in YOUR script. they are alreasy inside the INVENTORY.HPS.

OR are you putting the function : Destroyparticles...... in the inventory.hps


RE: Help With Scripting Please :D - Aglowglint11 - 07-15-2014

Oh okay. I'l have to see if it works nao.

Yus it worked, Thank you. Big Grin


RE: Help With Scripting Please :D - DnALANGE - 07-15-2014

Your welcome
Did everything worked?
You can give people reputation if they helped you good.
Press on the name who helped or you think they deserve a reputation (RATE)This is just a sort off kudo, nothing special.
NOT saying adding for me now, just saying you can give them away for free just some extra thingy for the people who helping others.