What's new

RPG MAKER VX tutorials


azurezero

Tentacle God
Joined
Feb 22, 2010
Messages
2,993
Reputation score
315
Just thought i'd make a thread here for anyone who has questions about things they're having trouble with in making their games, I'm pretty good at eventing :)
 

BlueLight

Demon Girl Pro
Joined
Dec 9, 2012
Messages
159
Reputation score
15
Re: RPG MAKER VX tutorials

I was trying to help someone with their project and they kept doing stuff like

int sexy = 50; // base value
sexy = 30;// increase sexy value by 30, it would be horrible if i over ride the sexy value!
note, i program in java, not ruby; so likely the code i show wont compile.

Anyways so my question is, how do i make a getter and setter for variable sexy. Also, how do you force sexy never to be less than 0 and never higher thn 100?

Normally i would say
this.sexy = Math.max(Math.min(newSexy,100),0);
 
Last edited:

Atmo

Sex Demon
Joined
Dec 22, 2010
Messages
296
Reputation score
13
Re: RPG MAKER VX tutorials

Variable are easy, and you can use a "Common Geral Event" to limit this.

If Variable 001 "Sexy" => 100
Variable 001 = 000
end
Something like that, i don't remember...
 

BlueLight

Demon Girl Pro
Joined
Dec 9, 2012
Messages
159
Reputation score
15
Re: RPG MAKER VX tutorials

Variable are easy, and you can use a "Common Geral Event" to limit this.



Something like that, i don't remember...
So with the code you showed, that would just reset the value to 0 whenever the variable gets to 100; is that correct? Not what i exactly what i wanted but i think you told me enough to fix it on my own.

However, something i forgot to clarify that the lower code, i put in setter methods (functions, sub routines and other words for method) . Is the same that possible with ruby? From what i understand the code for calling a getter or setter is auto generated in ruby.
 

UrineOnU

Cthulhu
Joined
Feb 2, 2011
Messages
369
Reputation score
40
Re: RPG MAKER VX tutorials

If you do not want to bother with ruby coding, You can call the variable anytime via switch and parallel process the variable handler with conditions, that's the simplest way to deal with variables in rpg maker, I think you need to say $game_variables[1](Is referencing variable 1 in the engine if that is sexy i think) for a script.

def $game_variables[1] ==50
if $game_variables[1]+=100
elseif [$game_variables[1]]<100 && [$game_variables[2] ] > 100

Not sure I probably just wrote gibberish, I never really bothered to use the scripting in rpgmaker because I never needed to, but there are some things that you can't do without it so it's good to know if you have a special thing you need for your project.

edit:forgot to mention the "$" sign in ruby scripting is defining that it is a global variable and a "@" sign is a class variable.
 

Attachments

Last edited:
OP
azurezero

azurezero

Tentacle God
Joined
Feb 22, 2010
Messages
2,993
Reputation score
315
Re: RPG MAKER VX tutorials

I was trying to help someone with their project and they kept doing stuff like


note, i program in java, not ruby; so likely the code i show wont compile.

Anyways so my question is, how do i make a getter and setter for variable sexy. Also, how do you force sexy never to be less than 0 and never higher thn 100?

Normally i would say
I'd use a parralel process that checks (conditional branch) if the number is below 0 and set the variable to 0, and then checks if its over the maximum and set it to the maximum, you could call it as a common event though every time you have an event add to it




oh though urine seems to be good at scripting aspects, :)


I was happy when i first made a clock event work without using a tutorial
 
Top