Frictional Games Forum (read-only)
Scripting Help - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: SOMA (https://www.frictionalgames.com/forum/forum-55.html)
+--- Forum: User created content (https://www.frictionalgames.com/forum/forum-79.html)
+---- Forum: Technical Support (https://www.frictionalgames.com/forum/forum-80.html)
+---- Thread: Scripting Help (/thread-31270.html)

Pages: 1 2


Scripting Help - Chet315 - 10-10-2015

I'm used to Javascript in for Unity3D, and I know HPL is completely different, but just one quick question.

Why are there 2 true/false values in a line such as
"Set_EntityActive ("EntityName", false, true);"?

Like, what are are each true and false value for?

I apologize for my ignorance.


RE: Scripting Help - WALP - 10-10-2015

they are parameters that change a bool variable.

I cant really explain it in your example, since you are using an incorrect function, perhaps it is an outdated one from HPL2?

In HPL3 it is called Entity_SetActive.

A better example would be Entity_PlayAnimation() which among other parameters has 2 bool parameters.

The first bool parameter decides if animation should loop, and this needs a true or false information for SOMA to know what to do.
the second bool parameter decides if a transition animation, given such exists, should be played before. for SOMA to know what to do it again needs a true or false information.

So when there are multiple false or true, thats really just the scripter answering yes or no to a bunch of things the function can do.

Note there are also parameters for non bool, like EntityName which is a tstring, here SOMA needs info on what entity you want to set active.


RE: Scripting Help - Mudbill - 10-10-2015

I don't know exactly what the other boolean is for, but finding out shouldn't be too difficult. If you've set up CodeLite, it should give suggestions for syntaxes, explaining what the parameters do. Otherwise, you'll have to read some documentation to know, or dig into the deeper files of where these functions are defined, like in hps_api.hps.


RE: Scripting Help - WALP - 10-10-2015

(10-10-2015, 10:06 PM)Mudbill Wrote: I don't know exactly what the other boolean is for, but finding out shouldn't be too difficult. If you've set up CodeLite, it should give suggestions for syntaxes, explaining what the parameters do. Otherwise, you'll have to read some documentation to know, or dig into the deeper files of where these functions are defined, like in hps_api.hps.

Normally yes, but the function he is using is not a HPL3 function, at the very least not a normal one. Like I stated in my comment it has been changed to Entity_SetActive in HPL3, and codelite will only give you documentation for that.


RE: Scripting Help - Romulator - 10-10-2015

EntitySetActive(); does not have two booleans.

PHP Code:
Entity_SetActive("maintenance_infected_1"true); 

This would work just fine.

Entity_SetActive(const tString &in asName, bool abActive);

const tString &in asName: The name of the entity to make active/inactive
bool abActive: Changes the activation state. true = visible. false = invisible.


RE: Scripting Help - Mudbill - 10-10-2015

Well in that case, yeah OP, I don't know where you got this from.


RE: Scripting Help - Chet315 - 10-10-2015

(10-10-2015, 10:20 PM)The Mug Wrote:
(10-10-2015, 10:06 PM)Mudbill Wrote: I don't know exactly what the other boolean is for, but finding out shouldn't be too difficult. If you've set up CodeLite, it should give suggestions for syntaxes, explaining what the parameters do. Otherwise, you'll have to read some documentation to know, or dig into the deeper files of where these functions are defined, like in hps_api.hps.

Normally yes, but the function he is using is not a HPL3 function, at the very least not a normal one. Like I stated in my comment it has been changed to Entity_SetActive in HPL3, and codelite will only give you documentation for that.

I wasn't looking at a script when I posted my question and kin of asked blindly So, Second poster, I actually meant what you are meaning by "Entity_SetActive". However, I think my question was answered by what was said about the animations. I just wasn't sure why there were 2 bools. I figured one affected whether the entity was active, but couldn't figure out what the other was for. Thanks for the feedback. Much appreciated. Also appreciate not seeing a reply stating "You shouldn't have created a new thread."

Also, I understand that Entity_SetActive doesn't have two booleans. I was generalizing and asking why in any case there would be two. Again, this is a person coming from "gameObject.SetActive (true);"

I'm just getting a feel for how HPL3 coding goes.


RE: Scripting Help - Romulator - 10-10-2015

We welcome new threads so long as it isn't redundant. Your thread wasn't in any way.


RE: Scripting Help - Chet315 - 10-10-2015

Oh! For example, "01_01_upsilon_awake.hps" line 486 states:

"Lamp_SetLit (sSeal+"_Lamp", false, true);"

And basically what I was asking was why that has two bools.


RE: Scripting Help - Romulator - 10-11-2015

According to CodeLite, it states this for Lamp_SetLit();

[Image: c6a04883a0.png]

The first one will therefore, set whether the lamp is on or off.
And the second will be if effects should be applied (if any). For example, a lamp may fade in or out as an on/off animation.