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.

Handling Event Calls Through Scripting

Ok I am creating this crazy scene where you can harvest crops and such, and I can certainly do this through events. The only problem is that the event code is way too long for any user to possible comprehend and we all know that without the users understanding of how the script works, the script if pretty mush useleff. I need to write script in the script editor to execute event like attributes, but am unsure how to do the following things in the script editor:
  1. Change the graphic of a certain event (like Event 001), and also being able to control the way the graphic faces (like if I had a characterset with each tile being a different item, so I would need to get the 3rd item in the second row)
  2. Create a battle animation on a certain event (like a sword animation on Event 001)
  3. Change the tint
  4. Add a "wait" time
  5. Add a message
Any help with these topics would be most appreciated, and most definitely worthy of a rightful place in my "thanks to" portion.
 
Here goes...

1) To change the graphic of event:

Add this under class Game_Character 1
Code:
attr_accessor :character_name
attr_accessor :character_hue

Then, use a call script with:
Code:
event = $game_map.events[event_id]
event.character_name = 'Name Of Characterset'
event.character_hue = hue (0 to 360)

To change direction, use:
Code:
event = $game_map.events[event_id]
event.turn_down
event.turn_left
event.turn_right
event.turn_up

2) Use a call script with:
Code:
event = $game_map.events[event_id]
event.animation_id = animation_id

3) Change a tint of what?

4) Do you mean a wait based call script?

Something like:
Code:
for i in 0...(seconds * 10)
  sleep 0.1
  Graphics.update
end

5) Do you mean just show a message?

Code:
Call Script:
$game_temp.message_text = "This is some text,
  what's good about this is, you don't have
  to quote each line, and the interpretter
  automatically makes this a 4 line message."

I haven't tried it, but that should work (and the fact that I have $game_temp.message_text is just proof that I am sad :()
 
Yeah I can see how this would work if you used a call script in the event window, but what I am really looking for is event calls that you can make inside the script editor not the event window. For example I would like to call "$scene = Get_Tomato.new" in the event window and then all the rest would be in the script editor.

Also, by tint I mean like change the tint of the screen from almost like a day to night time thing.
 

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