Cranky Old Man
Posting Freak
Posts: 986
Threads: 20
Joined: Apr 2012
Reputation:
38
|
Jens! Could you reveal more HPL2 triggers?
On the wiki page for the script functions, Jens explained the types of interact callbacks as simply:
""OnPickup", "Break", "OnIgnite", etc"
That is a pretty important "etc", because you have left out what type of interactions can trigger scripts.
I tried to solve this myself, searching for the types online without results, and I tried fruitlessly wrestling with the Find command on Windows (which doesn't work). My best hope is that FG tells people what these interactions are, or where they are listed, or maybe we could get help from somebody with Unix or Grep installed who can search these files for us. Help!
|
|
05-07-2012, 04:53 AM |
|
Cranky Old Man
Posting Freak
Posts: 986
Threads: 20
Joined: Apr 2012
Reputation:
38
|
RE: Jens! Could you reveal more HPL2 triggers?
Edit:
This *additional* post was based on poor eyesight, so I removed its contents so that it wouldn't confuse anybody.
(This post was last modified: 05-07-2012, 06:55 AM by Cranky Old Man.)
|
|
05-07-2012, 06:08 AM |
|
Homicide13
Senior Member
Posts: 323
Threads: 41
Joined: Nov 2010
Reputation:
14
|
RE: Jens! Could you reveal more HPL2 triggers?
o.o Hmm, it looks to me that the item that is being picked up is being set to the global string var, not the type.
But the "asType" parameter is just set to the type of interaction that the player had with the object - similar to the "alState" parameter from the AddEntityCollideCallback function. It's useful in some circumstances, if you want to do something like
if(asType == "onIgnite") { /*Do stuff*/ }
and so you would be able to do certain things depending on what the player does with a certain object (in this case, if the player ignites the object, a certain action or set of actions are called).
(This post was last modified: 05-07-2012, 06:34 AM by Homicide13.)
|
|
05-07-2012, 06:33 AM |
|
Cranky Old Man
Posting Freak
Posts: 986
Threads: 20
Joined: Apr 2012
Reputation:
38
|
RE: Jens! Could you reveal more HPL2 triggers?
(05-07-2012, 06:33 AM)Homicide13 Wrote: o.o Hmm, it looks to me that the item that is being picked up is being set to the global string var, not the type.
Oh, you're right. While that's even weirder, then I guess that asType is just keeping track of exactly what happens to the entity.
Quote:But the "asType" parameter is just set to the type of interaction that the player had with the object - similar to the "alState" parameter from the AddEntityCollideCallback function. It's useful in some circumstances, if you want to do something like
if(asType == "onIgnite") { /*Do stuff*/ }
and so you would be able to do certain things depending on what the player does with a certain object (in this case, if the player ignites the object, a certain action or set of actions are called).
Yes, but nowhere is it explained exactly what type of interaction triggers what type. We covered when picking it up, when it breaks, and when it's set on fire. Then there's this "etc".
What other things can you do to it that will register (and thus be able to influence a script)?
|
|
05-07-2012, 06:50 AM |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
RE: Jens! Could you reveal more HPL2 triggers?
If you're in an experimental mood, you can try something like this to try and uncover possible interactions. Likelihood of actually finding one is probably very low though haha
// string array of types to test const string[] InteractionTypes = { "OnLook", "OnLookAt", "OnCollide", "OnStateChange" }; void EntityCallbackFunc(string &in type) { bool found=false; // if type matches something in our string array of tests, notify for(int i=1;i<=InteractionTypes.length();i++){ if(type == InteractionTypes[i-1]) { found=true; //debug message here or something }} if(!found) // debug here to notify that SOMETHING happened, but our names were wrong }
Now that I think of it......just make the callback function add a debug message reporting type. Then just play around with entities until you see a new message. Haha.
void EntityCallbackFunc(string &in type) { AddDebugMessage(""+type, false); }
(This post was last modified: 05-07-2012, 08:15 PM by palistov.)
|
|
05-07-2012, 08:07 PM |
|
Cranky Old Man
Posting Freak
Posts: 986
Threads: 20
Joined: Apr 2012
Reputation:
38
|
RE: Jens! Could you reveal more HPL2 triggers?
(05-07-2012, 08:07 PM)palistov Wrote: If you're in an experimental mood, you can try something like this to try and uncover possible interactions. Likelihood of actually finding one is probably very low though haha
// string array of types to test const string[] InteractionTypes = { "OnLook", "OnLookAt", "OnCollide", "OnStateChange" }; void EntityCallbackFunc(string &in type) { bool found=false; // if type matches something in our string array of tests, notify for(int i=1;i<=InteractionTypes.length();i++){ if(type == InteractionTypes[i-1]) { found=true; //debug message here or something }} if(!found) // debug here to notify that SOMETHING happened, but our names were wrong }
Now that I think of it......just make the callback function add a debug message reporting type. Then just play around with entities until you see a new message. Haha.
void EntityCallbackFunc(string &in type) { AddDebugMessage(""+type, false); }
Yes, thank you for helping me, but a more definite list would be best. This is a pretty important list, because every type can unlock a hidden feature on the engine.
|
|
05-08-2012, 12:48 AM |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
RE: Jens! Could you reveal more HPL2 triggers?
There's OnDeath, for entities of the enemy type as opposed to OnBreak. That's the only one I can definitely say exists apart from the ones you've already listed.
|
|
05-08-2012, 01:30 AM |
|
|