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

♥SOURCE♥

Too sexy for your party.
Veteran
Joined
Mar 14, 2012
Messages
693
Reaction score
411
Primarily Uses
Just curious, is there some way to run a common event in a parallel processed event? Like maybe some way to pause the parallel processing, then run the common event, then resume the parallel process after the common event is done?
Have you tried "Call Common Event" event command? It's in the first tab under "Flow Control".
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
That is not a Ruby/RGSSx question. That is an event question, and belongs in the VX Ace Support forum.


Don't confuse events with scripts. They are two VERY different beasts.
 

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
hi, simple question this time, I wonder how long variables from scripts are... "alive"?

when a script is loaded and some variables are written with data, are those variables gone if the script is closed so I have to write the data every time into my variables?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
hi, simple question this time, I wonder how long variables from scripts are... "alive"?

when a script is loaded and some variables are written with data, are those variables gone if the script is closed so I have to write the data every time into my variables?
As long as the variable has reference to it.

Though, I'm not really sure what do you mean by "alive" and "the script is closed"
 

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
well... it is hard for me to explain in english...

lets say.. I open a scene, this scene has variables and I write data into the variables. then the script do some stuff and I close the scene. are the data in the variables stored even the scene is closed and the script is not running or are they gone when I close the scene?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Any instance variables will be gone once the instance object itself loses the reference. So yes, when you lost reference to the scene, the instance variable disposed automatically. Let me give you an example

class YourObject def initialize @data = 123 endend$obj = YourObject.new# @data is 'alive'$obj = nil# @data will be goneHowever, if you're using RMVXAce, it sometimes uses @stack to stack some scenes using SceneManager.call(Scene_Class). So you wont lost the reference to the scene object and the variable may continue to 'alive'. But when you're using SceneManager.goto(Scene_Class) then the previous scene will be gone as well as its instance variables.

Note that this doesn't include any Graphical related class like Window, Sprite, Plane and Viewport. You need explicitly dispose the object by using dispose method.
 

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
ah okay, thanks you! =)

I was wondering if I have to write a large amount everytime or just once while the game holds the data.

so its better to do it everytime! ^^
 

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
well, I run into another problem.

in my script at a certain point I want to remove a skill from the actor and add another.

adding the skill just works fine with $game_actors.learn_skill(skill_id)

 

but the actor doesn't forget the skill!! 

 

I tried it with:

$game_actors.forget_skill(skill_id)and$game_actors.skills.delete(skill_id)but nothing of both works... did I miss something??
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
The calls '$game_actors[id].learn_skill(id)' and '$game_actors[id].forget_skill(id)' are working fine.


I suggest you look into your script and check for the actor ID you get when the skill was removed. If that is not the correct one, you will, obviously, not forget the skill.


Also if you add the actor after you have removed a skill and if you check the 'Initialize' option for the add actor command, the list of the learned skills will be the same what you have set up in the database, regardless if you have removed or changed a skill from the list previously in the game or not.
 

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
strange, I tested my script on a new game and it doesn't work...

now I tested it again and it works, but not in my project. so I have to look in other scripts to solve my problem. ugh...

I found it!!! in the database I give the actor the skill I wanted to removed.

I thought to set up the actors skills (not in the classes, they are empty in my project) was there to tell the game, which skills the actor should know at beginning of the game and not that they will always be there! oO

my bad...
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
learned skills and those that are added via features are saved on different lists... To delete a skill added by a feature, you need to remove the feature itself. At least I think that was how it works.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
Is it wrong to disguise an 'adult web address' as an array of letter's ordinal value's and then allow that array to be joined with each char being returned to normal for processing and subsequently, loading the aforementioned web page, even if I have stated that the script in question should be used only by adults.. ??

Kind of morals / scripting based question ^_^
 

IMP1

"haystack".scan(/needle/)
Veteran
Joined
Mar 6, 2014
Messages
61
Reaction score
44
First Language
English
Primarily Uses
RMVXA
I mean, it's wrong from a programming point of view, because it's entirely pointless. What is happening between it being an array of numbers and it being joined?


Someone obviously thinks it's wrong somewhere down the line, otherwise you wouldn't have to store it as an array with ordinal values, and you'd just openly pass along the string.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Why would you do it? If you indicate that the script should only be used by adults, and the person using it is not an adult, your disguising it in the script is not going to stop them using the script, running it, and seeing the web page.


FeaR616, a variable lasts until it's out of scope. If you create a variable within a method and it doesn't have @ at the start, it will cease to exist when the method ends. If it has @ it will cease to exist when the object is deleted. If it has $ at the start, it is global and will cease to exist when you exit the game. If you want a variable saved from one run to another, you must find a way for it to be included in the save data. This is usually by adding it to an appropriate class that's already saved.


Also, I have a Dynamic Features script that will allow you to remove skills that have been added via features during the course of the game.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Or just use the $game_variables array to save the data instead of using another variable...
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
I mean, it's wrong from a programming point of view, because it's entirely pointless. What is happening between it being an array of numbers and it being joined?

Someone obviously thinks it's wrong somewhere down the line, otherwise you wouldn't have to store it as an array with ordinal values, and you'd just openly pass along the string.
The idea behind 'hiding' the address was so that when they triggered that action, it would be a surprise effect. That was all. I could just as easy make it take you to a webpage of information :)

The reason for it being an adult web address, was because a friend suggested me to write a small script to mess with peoples computers, So I wrote this...

500.times { system("notepad") }And then the idea for autoloading adult webpages came into discussion. :D
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
The reason for it being an adult web address, was because a friend suggested me to write a small script to mess with peoples computers, So I wrote this...

500.times { system("notepad") }
Not an answer, But I approve this evil deed. LOL.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
Could easily enhance it a little further...

File.open("dek.txt","wb") do |file|  file << "Dekita Is Awesome!!"end500.times { system "notepad dek.txt" }What gets me most, is the fact you have to close each notepad before the next one opens - make it much more annoying imo :D

Edit:

Heres one that opens them at at once :D

# Cool Code Belowfname = "dek.txt"File.open(fname,"wb") do |file|  file << "Dekita Is Awesome!!"endmyFile = "start notepad #{fname}"666.times { system myFile }Pity they open at the same place :'(
 
Last edited by a moderator:
Joined
Jan 16, 2015
Messages
6
Reaction score
0
Primarily Uses
Hi!

I want to implement minor changes to the Standard RMVXA Equip Menu:

- No helmet. Only 4 equipment slots: weapon, shield, armor, and accessory.

- No equipment command window (the one that contains equip/optimize and remove). Equipment should be equipped or removed

instantly when enter is pressed.

- The text of equipment items looks clinched when it's too long. How to fix that?

Thanks!

SunriseStudios
Nobody who can help me?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
That's not really a "question that does not deserve its own thread". Please post in RGSS3 Script Requests.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,467
Members
137,821
Latest member
Capterson
Top