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
Scripting Help
Chet315 Offline
Junior Member

Posts: 4
Threads: 1
Joined: Oct 2015
Reputation: 0
#1
Scripting Help

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.
10-10-2015, 09:13 PM
Find
WALP Offline
Posting Freak

Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation: 45
#2
RE: Scripting Help

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.
10-10-2015, 09:32 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#3
RE: Scripting Help

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.

(This post was last modified: 10-10-2015, 10:06 PM by Mudbill.)
10-10-2015, 10:06 PM
Find
WALP Offline
Posting Freak

Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation: 45
#4
RE: Scripting Help

(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.
10-10-2015, 10:20 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#5
RE: Scripting Help

EntitySetActive(); does not have two booleans.

PHP Code: (Select All)
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.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
10-10-2015, 10:23 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
RE: Scripting Help

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

10-10-2015, 10:50 PM
Find
Chet315 Offline
Junior Member

Posts: 4
Threads: 1
Joined: Oct 2015
Reputation: 0
#7
RE: Scripting Help

(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.
(This post was last modified: 10-10-2015, 11:35 PM by Chet315.)
10-10-2015, 11:29 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#8
RE: Scripting Help

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

Discord: Romulator#0001
[Image: 3f6f01a904.png]
10-10-2015, 11:36 PM
Find
Chet315 Offline
Junior Member

Posts: 4
Threads: 1
Joined: Oct 2015
Reputation: 0
#9
RE: Scripting Help

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.
10-10-2015, 11:41 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#10
RE: Scripting Help

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.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 10-11-2015, 12:11 AM by Romulator.)
10-11-2015, 12:10 AM
Find




Users browsing this thread: 2 Guest(s)