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.

how can i use this?

hi.
i don't know how to use this script;;

this script is not from rmxp and i don't know there is script like this. (if it exist, please link)
this script is for manage the other events's self switches.


http://cfs12.blog.daum.net/image/28/blo ... 547652.jpg[/img]

instruction : write the below method in "event->moving root->script" like above screen shot.
method : selfswitch(switch number ,value,MAPid,EVENTid)

and, copy the below script to script editor (f11).

class Game_Event < Game_Event
  def selfswitch(_ch, _val = true, _map_id = 0, _id = 0)
    if _ch.type == String
      _ch = _ch.upcase
    elsif _ch.type == Fixnum
      _ch = ["A", "B", "C", "D"][_ch]
    end
    (_val == false or _val == 0) ? _val = false : _val = true
    _map_id == 0 ? _map_id = $game_map.map_id : nil
    _id == 0 ? _id = @id : nil
    key = [_map_id, _id, _ch]
    $game_self_switches[key] = _val
    $game_map.need_refresh = true
  end
end
[origin : http://rpgxp.gameshot.net/board]


i wrote this script like ths,

selfswitch(C, true, 4, 18)  (in moving-root of event)

was it wrong?
please instruct me how to use this scrpt with example.
 

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