Toto téma je několik let staré. Některé údaje se mohou týkat starší verze Visionaire Studia. Aktuální návody
Vytvářejte point & click adventury bez programování. Bezplatná verze umožňuje až 25 scén na projekt. Pro více scén nebo pro výdělek ze hry potřebujete licenci.
Zobrazit Indie Bundle Vyzkoušet zdarmaif math.random(100) <= 77 then
startAction("Actions[hit]")
else
startAction("Actions[miss]")
end
-- This is the random number generator that can be called.
function chance()
counter = 0
while counter < 20 do
counter=counter+1
random_number=math.random(80,100)
end
end
--
--
--
--
math.randomseed(os.time())
chance()
sum = random_number + AppleStamina + AppleReflexes - AppleFatigue
-- The last three variables are set in the character's Values tab.
over_possible = sum
if sum > 100 then
sum = 100
end
-- I need to be able to send the new value of AppleToHitChance back to the game.
-- Basically it needs to replace the value that was set in the character's Values tab.
AppleToHitChance = sum
aplStamina = getObject("Values[AppleStamina]")
aplStamina:getInt(VValueInt) -- would return integer value of aplStamina
aplStamina:setValue(VValueInt, 80) -- or add variable in place of number
game:getLink(VGameCurrentCharacter) -- gets currently active character
getObject("Characters[protagonist]"):getLinks(VCharacterActions) -- returns all actions of the linked character
-- etc...
-- These three lines should get me info from the character values tab, yes?
-- If AppleStamina is set at 2, then astamina in this script is now also 2.
astamina = getObject("Values[AppleStamina]")
areflex = getObject("Values[AppleReflexes]")
afat = getObject("Values[AppleFatigue]")
-- some extra number for the sake of example. this could be all manner of complex math...
random_number = math.random(1,10)
-- adding all of my various numbers together just doing some basic math
sum = random_number + astamina + areflex - afat
-- I need to be able to send the new value of AppleToHitChance back to the game.
-- Basically it needs to replace the value that was set in the character's Values tab.
-- This number will grow as the character gains experience.
-- Also, the above three values (AppleStamina, etc.) will grow as well and will need to change.
-- AppleToHitChance = sum
-- This is the part I really can't figure out... maybe too early in the morning & need more coffee.
-- are any of these close? do I need the character's name somewhere?
sum:setValue("Values[AppleToHitChance]")
sum:setValue(vAppleToHitChance)
sum:setValue(VAppleToHitChance)
AppleToHitChance:setValue(VValueInt, sum)
Toto téma je uzavřené, protože tu přes rok nikdo neodpověděl. Svůj dotaz můžete položit v novém tématu.
Nové téma