Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help With Scripting Please :D
Aglowglint11 Offline
Junior Member

Posts: 31
Threads: 8
Joined: Mar 2014
Reputation: 0
#1
Help With Scripting Please :D

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)

N00B
07-15-2014, 12:49 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#2
RE: Help With Scripting Please :D

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: (Select All)
AddEntityCollideCallback("Player""DeleteParticleHallway ""JustRemoveParticlesHallway"true1); 
Then make a scriptfunction like this
PHP Code: (Select All)
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: (Select All)
    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???
(This post was last modified: 07-15-2014, 01:17 PM by DnALANGE.)
07-15-2014, 12:58 PM
Find
Aglowglint11 Offline
Junior Member

Posts: 31
Threads: 8
Joined: Mar 2014
Reputation: 0
#3
RE: Help With Scripting Please :D

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 '('

N00B
07-15-2014, 01:21 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#4
RE: Help With Scripting Please :D

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.
(This post was last modified: 07-15-2014, 01:25 PM by DnALANGE.)
07-15-2014, 01:23 PM
Find
Aglowglint11 Offline
Junior Member

Posts: 31
Threads: 8
Joined: Mar 2014
Reputation: 0
#5
RE: Help With Scripting Please :D

(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.

N00B
07-15-2014, 01:26 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#6
RE: Help With Scripting Please :D

the last spoiler must have a /spoiler

THIS :
PHP Code: (Select All)
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
(This post was last modified: 07-15-2014, 01:28 PM by DnALANGE.)
07-15-2014, 01:27 PM
Find
Aglowglint11 Offline
Junior Member

Posts: 31
Threads: 8
Joined: Mar 2014
Reputation: 0
#7
RE: Help With Scripting Please :D

(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
}
}



N00B
07-15-2014, 01:28 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#8
RE: Help With Scripting Please :D

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
(This post was last modified: 07-15-2014, 01:31 PM by DnALANGE.)
07-15-2014, 01:29 PM
Find
Aglowglint11 Offline
Junior Member

Posts: 31
Threads: 8
Joined: Mar 2014
Reputation: 0
#9
RE: Help With Scripting Please :D

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

Yus it worked, Thank you. Big Grin

N00B
(This post was last modified: 07-15-2014, 01:36 PM by Aglowglint11.)
07-15-2014, 01:32 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#10
RE: Help With Scripting Please :D

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.
(This post was last modified: 07-15-2014, 01:43 PM by DnALANGE.)
07-15-2014, 01:40 PM
Find




Users browsing this thread: 1 Guest(s)