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.

[VX] 1st Character Slot effects gameplay

ikos

Member

Like a "Leader System".
Where, when an actor is in the first slot, the gameplay alters.
I had an idea where whoever was in the first slot, a switch would turn on. That seem s pretty much impossible with events, so i was wondering if a script of this existed. Any feed back is nice.

~Ikos out
 
I don't know how to make a complete script for this, but you can use this code to check which actor (by ID #) is in the first slot.

Code:
$game_party.actors[0].id == 1

You can put it in a Conditional Branch in a Parallel Process Common Event and turn on a switch, or just directly put commands in.
 

ikos

Member

Regi":28w9hv2q said:
I don't know how to make a complete script for this, but you can use this code to check which actor (by ID #) is in the first slot.

Code:
$game_party.actors[0].id == 1

You can put it in a Conditional Branch in a Parallel Process Common Event and turn on a switch, or just directly put commands in.

So is $game_party.actor[0] actor id, or the slot?
 
The "actor[0]" is the slot, and the number after is the ID.
And sorry, I didn't notice before this was for VX. I'm not sure if it'll work for RGSS2, but you can try it all the same.
 

omed

Member

tried that. didnt work in vx. try using this script snippet

Code:
module Omed_Formations
  #--------------------------------------------------------------------------
  #The id of the actor you wish to have in the first slot to 
  #activate switch/variable
  #--------------------------------------------------------------------------
  
  Actor_id = 1
  
  #--------------------------------------------------------------------------  
  #Set to either switch or Var
  #--------------------------------------------------------------------------  
  
  Switch_or_Var = "Var"
  
  #--------------------------------------------------------------------------  
  #Id of the switch/var you want to use
  #--------------------------------------------------------------------------  
  
  Switch_var_id = 1
  
  #--------------------------------------------------------------------------  
  #Amount to Set to Variable
  #-------------------------------------------------------------------------- 
  
  Var_Amount = 1
  
  
  end
  
class Scene_Map
  include Omed_Formations
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
    alias the_old_start start
  #--------------------------------------------------------------------------
  # * Add in start
  #--------------------------------------------------------------------------  
    def start
      the_old_start
      zomg
    end
  #--------------------------------------------------------------------------
  # * Da code
  #--------------------------------------------------------------------------
    
    def zomg
      for actor in $game_party.members
      if actor.id == Actor_id && actor.index == 0
        if Switch_or_Var == "Switch"
       $game_switches[Switch_var_id]= true
     elsif Switch_or_Var == "Var"
       $game_variables[Switch_var_id]+= Var_Amount
     end
       end
 end
end
end

lol quick thing i made. very newb at this so meh. make sure to make an event with the condition you want and add in whatever effects you want. might make a formations script if i feel like it. the downside of this is that you havta open up the menu for it to take effect
 

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