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.
Thank you. where can i find info related to this. like for example a specific event x coor, etc.
Can you please give me the adress of a site were all this is included.
thanks in advance
Thanks Again.
Im looking for a site that teach me how todo everything thats done eith events but with/in ruby. Do you know any site like that?
Like for example, how do one make the "wait" command in Ruby?
Try studying more about the Interpreter classes. There has almost all the information you need, but requires a very good knowledge at RGSS. Even I, when i get some questions, i come to check the default scripts to see how EB did that with RGSS ^^
By the way (I know I'm pushing it), how do one makes a picture stay for a long time (like when done with events). I already know how to make the picture appear.
Thanks...
Those pictures that we talk about are nothing more than Sprites with Bitmaps in them. (hope you know a little about the engine ^^ if not, just talk.)
Sprites has Z values, and the greater that value is, the more closer it will be to the hero. That makes sprites with lower Z values to stay behind those ones that has higher values. And since everything that you can see in the screen is a sprite and that some sprites changes their Z values periodically, what happens is that some default sprite (that represents tilesets, events or else) have got a Z value greater than that value defined for your sprite. Try that in a call event and note that the sprite will never disappear
See the high Z value? No default sprite even reaches that ^^
Also, sprites stays on the screen unless you dispose them, make them invisible or put their opacity equal to 0. Screen transitions also simulates the sprite erases, but with some more effect and eye-candy into it and affects all the sprites somehow. They don´t need to update unless you have put a flash effect on them.
EDIT: HEY! FOUND A COOL LINK! Sometimes it´s incredible on how i´m patient to write that -_-
"Try that in a call event and note that the sprite will never disappear"
"$sprite.z = 10000"
So when I call a picture it disappears because of a low "z" number?
So it means that if a put a high number to z (like 10000) the picture will not dissapear, unless I make another piture with a higher number?
Thank YOU.
By the way, how can a make the {if press "X button" do this} in ruby.
And how can I move my chara and events in ruby.
If you anwser all this you will be god to me.
Thank once more
The Input processing is held by the Input module. Each button has his own constant, look:
Code:
Arrow Down = Input::DOWN
Arrow Left = Input::LEFT
Arrow Up = Input::UP
Arrow Right = Input::RIGHT
Shift key = Input::SHIFT
Alt = Input::ALT
Control = Input::CTRL
A key = Input::X
S Key = Input::Y
D Key = Input::Z
Shift or Z keys = Input::A
Space, C or Enter keys = Input::B
ESC, Num 0 or X keys = Input::C
Q or PAGE UP keys = Input::L
W or PAGE DOWN keys = Input::R
There´re basically three modes of key checking, the common check, the trigger ckeck and the repeat check.
Code:
# For the basic check
Input.press?(<your_input_constant_here>)
# For the trigger check
Input.trigger?(<your_input_constant_here>)
# For the repeating check
Input.repeat?(<your_input_constant_here>)
For all of them, if a condition is valid they returns true, else they return false.
Basically, in the first, this condition is of the key is being pressed at the moment. In the second the condition is if the button is being pressed again after some time the player released the button. And in the third the condition takes in consideration how many time the player has been pressing the button (try holding the A key in notepad to take an idea ^^)
There´re more methods, so just check the help file.
Try pasting this in a map event set to parallel process. Also, make another event with ID 2 in any place of the map:
Code:
case Input.dir4
when 2
$game_map.events[2].move_down
when 4
$game_map.events[2].move_left
when 6
$game_map.events[2].move_right
when 8
$game_map.events[2].move_up
end
Weird isn´t it? xD It´s inaccurate but it´s just to show how things works. Basically each event or hero inherits froma class called Game_Character. This means that *almost* all the commands available for the hero will available for events. Also, all the events are held inside a hash in $game_map (so you access it in $game_map.events[<event_id>]), and the hero is represented by $game_player. Those move commands can be used even in hero or events, like:
Code:
# Moving hero down
$game_player.move_down
# Moving event 2 up
$game_map.events[2].move_up
# ... And so on.