Ruby/RGSSx questions that don't deserve their own thread

That is magnificent. One new question. So, I have this script:

module Frames Frame_List = ["Frame1", "Frame2", "Frame3", "Frame4", "Frame5", "Frame6"]endclass Scene_Map < Scene_Base alias milena_scene_map_start start alias milena_scene_map_terminate terminate alias milena_scene_map_update update attr_accessor 😛rogress #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start milena_scene_map_start @progress = 0 @plane = Plane.new @plane.bitmap = Cache.picture(Frames::Frame_List[@progress]) end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- def terminate milena_scene_map_terminate @plane.bitmap.dipose @plane.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update milena_scene_map_update # this is where my problem is: @plane.bitmap = Cache.picture(Frames::Frame_List[@progress += 1]) if @progress >= Frames::Frame_List.size @progress = 0 end # I want the frame to wait for a few seconds before it changes. endendHow can I make the map wait for a few seconds before the bitmap changes into a new one?
You could add smaller values to  @process  every frame to delay the switch to the next image:

@progress += 1.0 / 150  # Switch image about every 150 updates

@progress = 0  if @progress >= Frames::Frame_List.size

@plane.bitmap = Cache.picture(Frames::Frame_List[@progress])

Remember that array begin at index  0 , at the moment you are counting from 1 to 6 inclusive.

In addition, each time the scene is reset, your animation will start from the beginning again (for example after returning from a menu or battle). If you don't want this behavior, Scene_Map might be the wrong class to handle the @progress-counter. Unlike update_basic , the update method of Scene_Map is not called during transitions.
You can make a new variable named @start_time or something, set it to Graphics.frame_count when you start displaying your pic frames. You can do that in the start method, if you want to display these pic frames immediately.

Now, the condition would look like this:

@start_time = Graphics.frame_count if @start_time.nil? if (Graphics.frame_count - @start_time) % 60 == 0 #do stuffs here like: @plane.bitmap = Cache.picture(Frames::Frame_List[@progress]) @progress += 1 if @progress >= Frames::Frame_List.size @progress = 0 end endThis will change the pic after every 60 frames (1 second). You can increase the 60 in the code to increase the wait time.This code will start the frame change as soon as the map is loaded.
Another Fen and Sixth, you both are awesome. The script is working fine now. If you only know that this played a big role on what I want to achieve on what I was making. Thanks 🙂
@Another Fen:

Yeah, that's what I couldn't figure out.  I looked at it, but I didn't really get what syntax I was supposed to take from it.  Thanks a lot!
By any chance, I want to use a specific skill with the push of a button. How can I do that when I am in the map?
You could use a parallel process event command that waits for the button to be pressed. Don't need a script to do that, unless you want to use a key that's not commonly used (and then you'll need a keyboard script).
I feel like somewhere out there must be a comprehensive list of all root calls, variables, and functions.  I feel like this because whenever I search the forum for a basic thing like, "character position coordinates," and variants of it like, "how to find character positions RGSS3," "character position script," "actor location," and even vaguer variations...all I get are requests for scripts and no actual help on building your own scripts 😛

So, SOME of you are building scripts!  And you figured the calls for RPG Maker VX Ace out SOMEwhere!  Where should I look?  I don't feel this warrants its own thread, because this must've been asked a few dozen times and my Google-Fu and Forum Search-Fu are just failing me.  F1 in the program is a joke for looking up script calls/methods/functions.  And the interwebz' denizens seems to only be interested in using other peoples' scripts and not in developing their own.

I never thought it would be so difficult to just find out an object's X/Y coords on the screen 😛
Pixel or Grid, idc which, just...SOMEthing to work off of lol.
For what I'm trying to do as an exercise (which has been failing lol)...in Actiosncript, it'd be like...
x1 = _root.Event001._x;
x2 = mouse.x;
xdif = Math.abs(x1-x2);

trace(xdif+" is the distance between the Mouse and the Event");

In other words...

Record to the variable x1 where the event Event001 is horizontally located.

Record to the variable x2 where the mouse currently is horizontally located.

Record to the variable xdif the absolute value of x1-x2.

Print to the debug screen (or in RGSS3 msgbox_p for simplicity), "[xdif] is the distance between the Mouse and the Event"

Has to be simple, I might just be stupid and incapable of finding /any/ comprehensive resource.

...to sum it up, I don't want to be just another "cargo cult programmer" ;D
F1 contains pretty much just a script reference of hidden classes. It still definitely is useful, vital even. Of course without knowing the appropiate ontology using script references becomes rather tedious and bothersome.

Other than that you will have to investigate the standard scripts yourself. Luckily the amount of code is low enough that checking it all is actually feasible, though really boring.

As for your particular example please do note that RGSS3 does not contain mouse interactivity and integration out of the box. It must be built from scratch.

*hugs*

 - Zeriab
Spoiler
I feel like somewhere out there must be a comprehensive list of all root calls, variables, and functions.  I feel like this because whenever I search the forum for a basic thing like, "character position coordinates," and variants of it like, "how to find character positions RGSS3," "character position script," "actor location," and even vaguer variations...all I get are requests for scripts and no actual help on building your own scripts 😛

So, SOME of you are building scripts!  And you figured the calls for RPG Maker VX Ace out SOMEwhere!  Where should I look?  I don't feel this warrants its own thread, because this must've been asked a few dozen times and my Google-Fu and Forum Search-Fu are just failing me.  F1 in the program is a joke for looking up script calls/methods/functions.  And the interwebz' denizens seems to only be interested in using other peoples' scripts and not in developing their own.

I never thought it would be so difficult to just find out an object's X/Y coords on the screen 😛
Pixel or Grid, idc which, just...SOMEthing to work off of lol.
For what I'm trying to do as an exercise (which has been failing lol)...in Actiosncript, it'd be like...
x1 = _root.Event001._x;
x2 = mouse.x;
xdif = Math.abs(x1-x2);

trace(xdif+" is the distance between the Mouse and the Event");

In other words...

Record to the variable x1 where the event Event001 is horizontally located.

Record to the variable x2 where the mouse currently is horizontally located.

Record to the variable xdif the absolute value of x1-x2.

Print to the debug screen (or in RGSS3 msgbox_p for simplicity), "[xdif] is the distance between the Mouse and the Event"

Has to be simple, I might just be stupid and incapable of finding /any/ comprehensive resource.

...to sum it up, I don't want to be just another "cargo cult programmer" ;D
I know exactly what you mean!! xD
luckily I found these two threads where almost every event command call is in equivalent to the script call, it helps me a lot!

this and this

otherwise you can look in the script list into "Game_Interpreter" there is also the code of the event commands. and for everything beyond that... investigate other scripts that do ... nearly.. what you want to do. ^^
Thank you both!  And I didn't mean to say "a joke" as in F1 is useless...it's actually very complete for covering the basics and letting you know how the program holds itself as a compiler.


EX:

Spoiler
Some method calls and control structures take the form of operators for ease in programming. Ruby contains the following operators:
high ::


[]


**


-(unary) +(unary) ! ~


* / %


+ -


<< >>


&


| ^


> >= < <=


<=> == === != =~ !~


&&


||


.. ...


?🙁conditional operator)


=(+=, -= ... )


not


low and or


"High" and "low" signify the operators' priority level. For example, "&&" has a higher priority than "||", so it would be interpreted in the following way:


a && b || c # => (a && 😎 || c


a || b && c # => a || (b && c)
and

Spoiler
Double-quoted string expressions are subject to backslash notation and expression substitution. Single-quoted strings are not (except for \'(single quotation) and \\(backslash itself)).


String literals with a space on either side are treated as a single string literal.


p "foo" "bar" # => "foobar"


Backslash Notation


The backslash character (\) is the same as the yen sign (¥) used in Japanese fonts.


\t


tab (0x09)


\n


newline (0x0a)


\r


carriage return (0x0d)


\f


form feed (0x0c)


\b


backspace (0x08)


\a


bell (0x07)


\e


escape (0x1b)


\s


space (0x20)


\nnn


character at octal value nnn (n = 0-7)


\xnn


character at hexadecimal value xnn (n = 0-9, a-f)


Expression Substitution


In double-quoted strings and regular expressions, the form "#{expression}" can be extended to the (string of the) contents of that expression. If the expressions are variables beginning with either $ or @, the surrounding braces may be omitted and the variable can be expressed as a #variable. The character # is interpreted literally if it is not followed by the characters {, $, or @. To explicitly prevent expression substitution, place a backslash in front of the #.


$ruby = "RUBY"


p "my name is #{$ruby}" # => "my name is RUBY"


p 'my name is #{$ruby}' # => "my name is #{$ruby}"
I was definitely just spoiled by Flash's Actionscript dictionary comprehensively covering every single thing that came with it out of the box.  It really was a "hold-your-hand" programming language which -- as coddling as it was -- made it easy to master.  I suppose I figured with how long this has been around someone would have made that for the Ruby use in RGSS3.


Which....actually, from the two threads that FeaR616 posted...seems to be essentially what was done!  Although not a one-stop-shop, it's close enough!  Thank you both SO MUCH for your time!  And FeaR, I don't know how I didn't stumble across those until now, but they're excellent!  And I mean it I really don't know HOW I didn't come across those...ESPECIALLY considering the Script Call Collection for ACE is a PINNED TOPIC!  Jeeze >_< I feel the sting of being a noob as though it were branded on my forehead haha...
@Philsco:

haha, no problem. ^^ it took me some time too to find it... and you know what? I found the "introduce yourself" subforum just TODAY!! XD after almost six month...

but I know how you must feel... as I looked in the help file, I thougt "WTF ..." as this are all things I already know but not how the actual commands are. this forum helped me a lot since today and I am very glad that I am here and bookmarked the most important threads for me... which are mostly "which command do what stuff" things ^^  ...so... happy coding! =)
Oh, you should definitely look up Ruby 1.9 documentation on the net. RGSS3 is based on that version.
Ruby 1.9?  Got'cha \m/


...And got it!


http://ruby-doc.org/core-1.9.3/


...and.......omg, I just realized this forums has  🤘   BD   🤘  


....I'm...I'm home!  :'D
You might also want to bookmark the RGSS3 reference:
http://rgss3doc.razelon.tk/en/rgss3/index.html
I've been lurking for a while, trying to figure out things on my own before bugging anyone. If anyone has asked these questions before, I apologize. I wasn't sure if I should break this up into three different posts first, etiher.

All of these are applicable to VX Ace.

Question #1: Is it possible to import a completed save game from one project into another? (I was considering making an episodic RPG vs. a GIGANTIC RPG)

Question #2: Is it possible to have the enemies level up as the player does?

Question #3: Is it possible to make an alchemist command in combat? (I wanted to make an engineer class that makes things on the fly during combat)

If anyone also knows a good starting point for learning RGSS, would you mind pointing me in the right direction? I have a background in Visual Basic and C/C++ but it's very rusty. I appreciate all input very very much! 🙂  

Thanks!
I'm using a battle script which allows me to code skills. There is a function for an if condition, which the condition needs to be a line of code that calls something.

For example, $game_variable[1], target.result.hit?, etc.

What i've been desperatly searching for is a line of code which can call the target's state, specifically when an enemy uses a specific skill on an actor, it will check if that actor has a state applied to him/her.

I've checked various script call topics but non seem to have in-battle codes. So does anyone how to go about this?
target.state?(id)


@ladykataana, your questions are not "script questions that don't deserve their own thread". Please do a search, as some of these have already been asked and answered several times, and if you can't find an answer, create individual threads for each question, in the appropriate forums.
So simple lol thanks a lot!
I feel like an idiot at the moment... how can I read the enemies HIT value during battle??

I tried it with printing $game_troop.member[0].xparam[0].to_s but I only get errors ...

Original thread: https://forums.rpgmakerweb.com/threads/ruby-rgssx-questions-that-dont-deserve-their-own-thread.150/