What we need is action parts for creating
elseif,
and &
or. All three of those operators reduce the amount of end's needed.
This is the reason I often end up using the execute a script action part so that I can create complex if queries through code.
The editor if query system is much better in 4.x than 3.7.1 as it now has tree branching & you can collapse / expand the various if queries to see what belongs to which query.
Ok here's a quick mock-up (Lua) of the second code block in your post...
if Conditions["blah"].ConditionValue then
if game.CurrentCharacter.Scene == game.CurrentScene then
startAction("Actions[test1]")
else
game.CurrentScene = game.CurrentCharacter.Scene
end
else
startAction("Actions[test2]")
end
... your example is not really all that great for me to show the difference between editor if query system vs. the scripting method. So I'll provide another one...
if Conditions["blah"].ConditionValue and not game.CurrentScene:getBool(VSceneIsMenu) then -- used getObject for SceneIsMenu because it doesn't like shorthand method.
if game.CurrentCharacter.Scene == game.CurrentScene then
return true
elseif game.CurrentCharacter.Scene ~= game.CurrentScene then
game.CurrentScene = game.CurrentCharacter.Scene
end
end
... notice I reduced it down to two
end operators because I used
elseif &
and operators.
elseif,
and &
or operators allow you to create a continuation inside of the same query line, thus removing the need to close each query off individually.