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.

Weapon calling skill

Code:
 # * Make Action Orders

  #--------------------------------------------------------------------------

  def make_action_orders

    # Initialize @action_battlers array

    @action_battlers = []

    # Add enemy to @action_battlers array

    for enemy in $game_troop.enemies

      @action_battlers.push(enemy)

    end

    # Add actor to @action_battlers array

    for actor in $game_party.actors

        actor2 = Marshal.load(Marshal.dump(actor))

        # Changue the action kind and skill id

        actor2.current_action.kind = 1

        actor2.current_action.skill_id = 7

        actor.current_action.kind = 0

        p actor2.current_action.kind

        p actor.current_action.kind

        #@action_battlers.push(actor)

        #@action_battlers.push(actor)

        @action_battlers.push(actor2)

      #@action_battlers.push(actor)

    end

My problem with that code is that it dont work fort thre actor2. Now, it just attack or whatever two times. If i put only the actor 2, it does nothing.
 

Star

Sponsor

I don't think you did it right. Something about the actor2 seems off. Are your trying to get this specifically for the 2nd actor? It would be more like actor2 = $game_party.actors[1] for it to work. Right now you only have an "for actor loop" saying all Actors will do this then added a 2 ruining the "for actor loop"
 
No, he doesn't need to do that, Star, the problem is that someone split his requests thread and now the explanation on what he was trying to achieve there looks quite awkward for anyone who didn't read the first topic.

I know someone suggested that you could clone the actor in such a way, let me try to test this in the (XP) default battle system to see what is actually failing here.

Anyway, when the battle interpreter "notices" (I'm not completely sure that's the case) there is a duplicated or clone battler, it just terminates the execution of techniques after the first repetition...
 
Sorry, i think i missed some info. I use the actor2 copy because i need to put a magic action before the attack. Then, i copy it and changue id, and type to make the appropiate skill call. This for every actor.
 

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