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
I Need Someone To Help Me With Scripting!
MiaMasonSilentHill Offline
Junior Member

Posts: 3
Threads: 1
Joined: Sep 2011
Reputation: 0
#1
Wink  I Need Someone To Help Me With Scripting!

I am new to scripting in amnesia, I enjoy it and I have a lot of imagination so I need to know a few things about scripting in .hps.


I know the basics such as, Giving Items From File and making a monster appear behind you when you pick up an item. I can't seem to get collides to work, I make the area and the item to make work, I do the scripting with collide callbacks. I don't understand what I put in the boxes on the level editor on the entity properties. Please help, I'd love to meet some like minded people on here!


Yours Sincerely
Mia Mason From Silent Hill
09-13-2011, 09:55 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: I Need Someone To Help Me With Scripting!

(09-13-2011, 09:55 PM)MiaMasonSilentHill Wrote: I am new to scripting in amnesia, I enjoy it and I have a lot of imagination so I need to know a few things about scripting in .hps.

I know the basics such as, Giving Items From File and making a monster appear behind you when you pick up an item. I can't seem to get collides to work, I make the area and the item to make work, I do the scripting with collide callbacks. I don't understand what I put in the boxes on the level editor on the entity properties. Please help, I'd love to meet some like minded people on here!

Yours Sincerely
Mia Mason From Silent Hill
Collide Callbacks are probably one of the simplest things to do with HPL2.
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
   Calls a function when two entites collide.
  Callback syntax: void MyFunc(string &in asParent, string &in asChild, int alState)
  alState: 1 = enter, -1 = leave    asParentName - internal name of main object
  asChildName - internal name of object that collides with main object (asterix (*) NOT supported!)
  asFunction - function to call
  abDeleteOnCollide - determines whether the callback after it was called
  alStates - 1 = only enter, -1 = only leave, 0 = both
Taken straight from the wiki.
For example, if you had
AddEntityCollideCallback("Player", "ScareArea", "Scare", true, 1);

When Player collides with ScareArea, the callback Scare is called, and the callback removed.

Since the alState (the number at the end) is 1, the callback is only called when the player enters this area. The boolean value before it, true, is a remove function. That means that the callback no longer exists once it is called.
Eg) Player walks into a room, and a noise is played. If it is set to false, whenever the player enters the area, a sound is played. If it is set to true, the sound will be played once, and not be repeated.

Hopefully that was clear enough. Smile

09-13-2011, 10:25 PM
Find
MiaMasonSilentHill Offline
Junior Member

Posts: 3
Threads: 1
Joined: Sep 2011
Reputation: 0
#3
Wink  RE: I Need Someone To Help Me With Scripting!

(09-13-2011, 10:25 PM)Obliviator27 Wrote: Thanks That's A Real Help!.
(09-13-2011, 09:55 PM)MiaMasonSilentHill Wrote: I am new to scripting in amnesia, I enjoy it and I have a lot of imagination so I need to know a few things about scripting in .hps.

I know the basics such as, Giving Items From File and making a monster appear behind you when you pick up an item. I can't seem to get collides to work, I make the area and the item to make work, I do the scripting with collide callbacks. I don't understand what I put in the boxes on the level editor on the entity properties. Please help, I'd love to meet some like minded people on here!

Yours Sincerely
Mia Mason From Silent Hill
Collide Callbacks are probably one of the simplest things to do with HPL2.
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
   Calls a function when two entites collide.
  Callback syntax: void MyFunc(string &in asParent, string &in asChild, int alState)
  alState: 1 = enter, -1 = leave    asParentName - internal name of main object
  asChildName - internal name of object that collides with main object (asterix (*) NOT supported!)
  asFunction - function to call
  abDeleteOnCollide - determines whether the callback after it was called
  alStates - 1 = only enter, -1 = only leave, 0 = both
Taken straight from the wiki.
For example, if you had
AddEntityCollideCallback("Player", "ScareArea", "Scare", true, 1);

When Player collides with ScareArea, the callback Scare is called, and the callback removed.

Since the alState (the number at the end) is 1, the callback is only called when the player enters this area. The boolean value before it, true, is a remove function. That means that the callback no longer exists once it is called.
Eg) Player walks into a room, and a noise is played. If it is set to false, whenever the player enters the area, a sound is played. If it is set to true, the sound will be played once, and not be repeated.

Hopefully that was clear enough. Smile

09-13-2011, 10:41 PM
Find




Users browsing this thread: 1 Guest(s)