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

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
*enters defensive mode* - It was only a quick mock up method after all....

I didnt even think of 'what if the actor has already joined' lol

That being said you method is very nice. much more efficient in terms of making the actor 'as it should be' in terms of hp and stats.

I especially like how you yield the actor data for a block - that is very handy. I think I will be throwing that into some of my own code :p

Overall... I like. Pity it wasnt me that needed the method but I am sure soul will be thrilled with that one :D
 

iNBee317

Villager
Member
Joined
Jun 10, 2014
Messages
15
Reaction score
0
First Language
English
Primarily Uses
z=$game_variablesz[81]= "acr"x=z[81]z[82]=$game_actors[1].xstat.xHow can I get it so that it reads the x at the end of the call (xstat.x) as the value that x contains. I am trying to make it so I can specify a type of parameter "acr", "str", etc. that I created with crystals extra stats script. So above I want it to function as if i was asking z[82]=$game_actors[1].xstat.acr. as of righ tnow I get an error because it isnt recognizing x as a local variable. Same goes if I try to replace x with the variable z[81]
 

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
247
Primarily Uses
Use send to dynamically call a method such as this.

Code:
# Example, same as calling `'hello'.reverse`.'hello'.send(:reverse) # => "olleh"# Based on your posted snippet.z = $game_variablesz[81] = 'acr'z[82] = $game_actors[1].xstat.send(z[81])
 

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
@Bee - your method was actually calling a .x or .z[81] method on $game_actors which is clearly non-existent

Do this one instead

z=$game_variablesz[81]= "acr"x=z[81]z[82]=eval("$game_actors[1].xstat.".concat(x))though I don't see the use of X so

z=$game_variablesz[81]= "acr"z[82]=eval("$game_actors[1].xstat.".concat(z[81]))that way it first gets the value of z[81], concats it into the $game_actors[1].xstat before evaluating it...
 
Last edited by a moderator:

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
247
Primarily Uses
z=$game_variablesz[81]= "acr"z[82]=eval("$game_actors[1].xstat.".concat(z[81]))
No.

Do not do this. This performs the exact same action that I posted, but does it in a significantly slower -- and more error-prone -- way using eval. Usage of eval is extremely ill-advised, particularly when a suitable alternative (like send) exists and can provide the same functionality without the performance hit and peculiarities.

Also, anyone learning Ruby and RGSSx programming, please take the time to learn how to perform tasks without the crutch that is eval. You will thank me for it.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
Is there a way to show a battler for the actors, that takes hits and all, like on XP, without using a whole new battle system? The comments on the script file in portuguese gives the impression it'd be just a few lines to make it work, but I can't make it...
 
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
@Solistra - Oh I see, never knew that... XD

@Waterguy - Well, there is Yanfly's Visual Battlers though it uses the character sprite as the battler
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
ah, ok, I'll take a look.
oh, and... is there a way to see an actor's position in the party?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
$game_actors[id].index should do it.


0 means leader, 1 means first follower. So your battle members will be 0, 1, 2 and 3.
 
Last edited by a moderator:

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
Thanks, it worked.

Sorry for asking so much, but does anyone know how to see if what was used was a skill or an item?
 

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
depends on where you'd want it... normally, the item/skill used is denoted by "item" on the methods that they're handled... from there you could just do something like

item.is_a?(RPG::Skill) to determine if it's a skill or not (meaning it's an item)
 

Dickjutsu

Producer for Nic3Ntertainment
Veteran
Joined
Oct 23, 2012
Messages
139
Reaction score
34
First Language
English
Primarily Uses
RMMV
Hi.  I'm trying to remove the Party Menu (the one that lets you Fight or Escape).  I've searched for a way and found a snippet of code that Tsukihime had given someone else.  But I couldn't find an original post where the code was given out.  I've been trying to put the snippet into my default scripts, but no matter where I put it or how...I just wind of crashing the whole thing when a battle starts (some times I don't even make it to the battle screen).

Can anybody tell me where this snippet goes, or some other way to get rid of the screen?  There aren't any battles in my game that you can Escape from, so it's pointless to have the screen come up.

Attached the screenshot of the code snippet.

Thanks!

View attachment 14414
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
thanks! I used item.is_a?(RPG::Item) though, but it worked!
 

Duban65

Villager
Member
Joined
Jun 18, 2014
Messages
9
Reaction score
0
First Language
German
Primarily Uses
Hey Guys,

I hope this is the right thread for my question.

The default font size of the VX Ace is very big, that is the reason why i set them

to 18 instead of 24. Next step the line_height is set to 18. Now the cursor or

selectable_window is fit to the font, but my SkillMenu used the default fontsize.

My problem now is that the cursor does not fit to the buttons.

How can i resize the cursor only in this Menu.

Here is a picture of the menu:

http://www.directupload.net/file/d/3666/y68h8vno_png.htm

If the code is wanted i will post the script.

Thanks
 

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
In Window_Selectable you have this method:

  #--------------------------------------------------------------------------  # * Get Rectangle for Drawing Items  #--------------------------------------------------------------------------  def item_rect(index)    rect = Rect.new    rect.width = item_width    rect.height = item_height    rect.x = index % col_max * (item_width + spacing)    rect.y = index / col_max * item_height    rect  endso you need to make the two methods item_width and item_height. This methods are responsable for the size of the cursor.

If your window inherits from window_selectable just add this two methods to your window and optimize the values. If you already have these methods, just change the values.
 
Last edited by a moderator:

Bunny

Warper
Member
Joined
Jun 7, 2014
Messages
4
Reaction score
0
First Language
English
Primarily Uses
How would I go about setting up NPC routines within a game time. For example, Mary can be found in her shop between the times 8am-5pm, but from 6pm till late you can find her in the inn. 

Similary, the best way to set up time restrictions for entering houses (a lot of houses). You cannot enter NPC's homes when its night.

(RMVXAce) 
 
Last edited by a moderator:

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
I think the best would be through game variables...
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
How would I go about setting up NPC routines within a game time. For example, Mary can be found in her shop between the times 8am-5pm, but from 6pm till late you can find her in the inn. 

Similary, the best way to set up time restrictions for entering houses (a lot of houses). You cannot enter NPC's homes when its night.

(RMVXAce) 
If you want your computer time to set the NPC routes you can use the script below;

http://dekitarpg.wordpress.com/2012/12/24/realtime-effects/

That will allow you to turn on / off switches and whatever using realtime :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Hi.  I'm trying to remove the Party Menu (the one that lets you Fight or Escape).  I've searched for a way and found a snippet of code that Tsukihime had given someone else.  But I couldn't find an original post where the code was given out.  I've been trying to put the snippet into my default scripts, but no matter where I put it or how...I just wind of crashing the whole thing when a battle starts (some times I don't even make it to the battle screen).


Can anybody tell me where this snippet goes, or some other way to get rid of the screen?  There aren't any battles in my game that you can Escape from, so it's pointless to have the screen come up.


Attached the screenshot of the code snippet.


Thanks!
That just goes into a new script slot below Materials. Put it underneath any other custom scripts you have.
 

Dickjutsu

Producer for Nic3Ntertainment
Veteran
Joined
Oct 23, 2012
Messages
139
Reaction score
34
First Language
English
Primarily Uses
RMMV
Really?  Good god, I'm miserable with scripts.  I thought, this whole time, that it had to replace something in the battle scripts.

All right, Shaz; thank you! :)
 

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

Latest Threads

Latest Profile Posts

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.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top