This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials
function distanceScriptTry (mc, opponent)
standingRight = getObject("Conditions[standingRight]")
standingLeft = getObject("Conditions[standingLeft]")
mc = getObject("Characters[MC]")
opponent = getObject("Characters[opponent]")
if mc.Position.x < opponent.Position.x
and
mc.Position.x - opponent.Position.x >=-300
then
standingLeft:setValue(VConditionValue, true)
else
standingLeft:setValue(VConditionValue, false)
end
if mc.Position.x > opponent.Position.x
and
mc.Position.x - opponent.Position.x <=300
then
standingRight:setValue(VConditionValue, true)
else
standingRight:setValue(VConditionValue, false)
end
end
local mc, opponent
function distanceScriptTry(mc, opponent)
mc = Characters[mc]
opponent = Characters[opponent]
-- + --
if mc.Position.x < opponent.Position.x and opponent.Position.x - mc.Position.x <= 300 then
Conditions["standingLeft"].Value = true
Conditions["standingRight"].Value = false
elseif mc.Position.x > opponent.Position.x and mc.Position.x - opponent.Position.x <= 300 then
Conditions["standingLeft"].Value = false
Conditions["standingRight"].Value = true
end
endhaving the variable the same name as the condition isn't goodsome programing languages its a bad thing
yeah i noticed i was getting ";" added to code after "<"
This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.
New threadDeponia, The Whispered World and more than 160 other games were made with Visionaire Studio. The free version covers up to 25 scenes. For more scenes there is Visionaire Studio PRO from €75, and to sell your game the Indie Bundle for €99.
Through December 1: all licenses 30% off, for example the Indie Bundle for €69.30 instead of €99. Applied automatically at checkout.