Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

actor class problem

I was working on a script that when in battle, the skill choice will be unique for each class e.g mage would have magic, thief would have steal etc... but it cant quite seem to get it to work. the closest I have is this part of the code but its still gives all the actors the same choice, im guessing the one that is last executed in the script :/ any help please ? some sort of loop maybe ?


Code:
    @bcommands = ["Steal", "Magic", "Dragon", "Skill"]

    s1 = $data_system.words.attack

    if $data_classes[0]

    s2 = @bcommands[3]

    end

    if $data_classes[1]

    s2 = @bcommands[2]

    end

    if $data_classes[2]

    s2 = @bcommands[1]

    end

    if $data_classes[3]

    s2 = @bcommands[0]

    end

edit: Also is there an else if statement in ruby scripting ?
 
I'm pretty sure there is a script for individual battle commands, which is basically what you're looking for, I don't have the link now, but use the search function and you should be able to find it around the forums. :thumb:
 
thanks man :]I found a link to a forum that needed me to sign up to view so I left that one, another I found handled the idea in a different way, this is just a little project for me to practise scripting but I cant find the right script to study for it haha. Is there an if else statement in ruby ?
 
just tried it and it didnt work :/ that would fix my problem aswell haha gutted :P

Edit: Think ive made it work, I had put elseif :D

edit 2: nar didnt work, the elsif statement works just didnt fix the script haha
 
the only thing I can think of is that maybe you have to specify that the class you are referring to is of the current actor, like battler.class[1] (that doesn't exist., but you get the point)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top