Jump to content

Desperate Wish: IF, THEN, ELSE IF, ELSE options in Mission Editor


Recommended Posts

Posted

Anytime you wanna get into logic like that with triggers it will always results in using a bunch of flags. Would need a trigger for each action anyway. It can be accomplished relatively easily via the lua predicate or do script using a lua statement. 

if trigger.misc.getUserFlag("whatever") > 0 then
	trigger.action.setUserFlag("action1", true)
elseif trigger.misc.getUserFlag("something") > 0 then
    trigger.action.setUserFlag("action2", true)
else
    trigger.action.setUserFlag("action3", true)
end

 

  • Thanks 1

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • 4 weeks later...
Posted
On 10/3/2022 at 9:20 AM, Grimes said:

Anytime you wanna get into logic like that with triggers it will always results in using a bunch of flags. Would need a trigger for each action anyway. It can be accomplished relatively easily via the lua predicate or do script using a lua statement. 

if trigger.misc.getUserFlag("whatever") > 0 then
	trigger.action.setUserFlag("action1", true)
elseif trigger.misc.getUserFlag("something") > 0 then
    trigger.action.setUserFlag("action2", true)
else
    trigger.action.setUserFlag("action3", true)
end

 

Yeah, I asked for this before I learnt LUA and scripting (still learning - trying to work out how to create edit waypoints in scripting is a freakin' nightmare).

I still think it you're primary focus is a GUI mission editor then it should cope with this type of thing without forcing people to learn lua/scripting.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...