Forum Jump :

Author Message


Posts: 3
Rank:


Level: Member

Country: us
Location: Texas
Occupation: Pretty much whatever they pay me to do
Age: 23
In-game name: Azaduur

 
#1 Posted at 2017-06-07 16:12        
     
So I made a set up that hides an object by default with a trigger(trigger1). condition: true, activation: X1 hideobject true, deactivation: X1 hideobject false. I made another trigger(trigger2) that activates upon player entry. condition: this, activation: trigger1 setTriggerstatements [false, X1 hideobject true, X1 hideobject false], deactivation:<blank>. This works. I enter the area, and X1 appears before my eyes but i get an error message which is too long for the box but it basically ends with "error type bool, expected string. missing '"

So I do a little more homework and rewrite the code to include quotations marks and again with apostrophes.
< trigger1 setTriggerstatements ["false", "X1 hideobject true", "X1 hideobject false" >
< trigger1 setTriggerstatements ['false', 'X1 hideobject true', 'X1 hideobject false' >

Both of those were successful at not generating an error message upon entry to the trigger. Nor did they actually do what I had intended. They simply dont show the object(X1) that is hidden by another trigger. I'm a sub novice scripter, I haven't a clue why the code that actually works generates an error message, while the ones that dont work, dont generate an error message. I'm asking what I need to correct so that I dont get an error message everytime I activate my trigger(which works).

This post was edited by Azaduur (2017-06-07 16:22, 187 days ago)


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2017-06-08 00:00        
     
With the condition set to "false" it can't work you need to use "this" or a variable that changes between true/false

If you use "this" then you will need to use the the triggers activation command link

An example of a changing variable would be :-
trigger1 setTriggerstatements ["round (time %1)==1", "X1 hideobject true","X1 hideobject false"];

The condition only becomes true once every second.


Advertisement


Author Message


Posts: 3
Rank:


Level: Member

Country: us
Location: Texas
Occupation: Pretty much whatever they pay me to do
Age: 23
In-game name: Azaduur

 
#3 Posted at 2017-06-08 01:06        
     
# F2kSel : "With the condition set to "false" it can't work you need to use "this" or a variable that changes between true/false"


When you say "can't work" could you elaborate as to why please? I only ask because when recreated, it does indeed "work", or that is...it does what I expect it to do, save for the error messaged. I don't fully understand true/false; I assumed that since I use true to have a trigger that starts "on" then, "false" would turn it "off" or start it "off". I suppose I don't really know anything about the parameters of "true/false" in the condition field.

Also, are you saying that the code you provided:

trigger1 setTriggerstatements ["round (time %1)==1", "X1 hideobject true","X1 hideobject false"];

..turns the trigger on and off every second...? So I'll have an item just appear-disappear-reappear every second? surely not...

[apologies if this post looks broken. I'm not sure how the quote feature works :^]
[yep...botched this up, probably shouldn't all be in a gray box >.>]


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2017-06-08 14:35        
     
The trigger evaluates the condition and if it's true it activates, false forces it to deactivate.

The code I posted is an example of that in operation in a repeating trigger.
First it has to activate so it can then deactivate.

If you 're getting some results then I suspect it's from something else.

If all you want is a player to enter the trigger and it to activate you need something like this

Hides the object
trigger1 setTriggerstatements ["true", "X1 hideobject true",""];

Reveals the object when player enters the trigger.
trigger2 setTriggerActivation ["WEST", "PRESENT", true];
trigger2 setTriggerstatements ["this", "X1 hideobject false","X1 hideobject true"];

Adjust the "WEST" to match the side of the unit your trying to detect.


Author Message


Posts: 3
Rank:


Level: Member

Country: us
Location: Texas
Occupation: Pretty much whatever they pay me to do
Age: 23
In-game name: Azaduur

 
#5 Posted at 2017-06-08 14:49        
     
Well F2kSel, thats more or less what I needed. I can tweak it a bit to make the object stay visible even after i leave trigger 2. I'm still confused why my way worked but yielded an error message. I recreated it in a blank VR map to ensure that nothing else has any affect. it stills works and still gives an error message, but I suppose thats a mystery that will remain unsolved.

You did present me with a working alternative and for that, i thank you.


Author Message


Posts: 45
Rank:


Level: Member

Country: nl
Location: Den Haag
Occupation: Mars or Pluto?
Age: 25
In-game name: Desperado070

 
#6 Posted at 2017-06-10 18:15        
     
You know the eden editor has modules to hide and show objects? much easier to use and check afterwards.
Just search the modules for "Show/Hide", make 1 which hides them (it will trigger automatically) and make a second one which shows the units, now sinc that one up with a trigger you wanna use. You could just make a trigger which activates upon player arrival.

Don't make it more complicated than it is.

Do not go where the path may lead, go instead where there is no path and leave a trail...