Script Call Support Boards

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
How do I get the Tileset ID of the current map?

I evented a time, night/day, calendar, weather system which runs as a common event. The system works perfectly fine, but I wanted an easier way to check whether or not the player is indoors. The idea is, if the current map is using the Interior or Dungeon tiles, my Indoors? switch is flipped. At the moment, I'm using an array of IDs designated as interiors(which is probably a better idea), but I'd still like to know how to do this.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
$game_map.tileset.id
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
Perfect. Thank you.
 

Joronjo

Veteran
Veteran
Joined
Sep 17, 2015
Messages
155
Reaction score
29
First Language
English Spanish
Primarily Uses
Judging by how this



and this



keep returning errors, how do i set up a switch/variable directly through scripts?

I originally wanted to store a string in a variable but that didn't work so i tried to go for a common event to store the information there and make a switch that turns on when the game begins, but i just can't get it to work.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Did you read the error they were returning?


You don't have them in a class or method, which means $game_switches doesn't even exist when you're trying to do that.


To turn on switches when the game begins, people usually just add a Control Switches command in an autorun/parallel event on the first map, that then turns on a self switch and add a second page conditioned by that self switch. You don't have to resort to scripts to do that.


And if you're doing events, you don't need to use a script call to change a switch.


Start a new thread with your question (as it's not about script calls), explain what you're trying to achieve, and then show us your events as you've got them set up.
 
Last edited by a moderator:

Joronjo

Veteran
Veteran
Joined
Sep 17, 2015
Messages
155
Reaction score
29
First Language
English Spanish
Primarily Uses
Ok. I didn't think that this was worth its own thread so i refrained from starting a new one.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
Having temporarily increased the MHP of an actor, I need a script call which will remove the extra HP when the increase is removed.

What happens is that the MHP is reduced, but the extra HP the character had remains, so the status page would show something like 221/203 (or whatever, I have no way of knowing what the figures will be as it happens repeatedly throughout the game).  Once the character is damaged in battle, the extra is lost, but he goes into battle with that bonus still present.  I did think of using a variable to store the MHP before the bonus is applied, but the player might level up between then and the time for the bonus to be removed, so that won't work.

I'm not sure that description is very clear, but it's the best I can do.  Sorry if it's a bit vague.

Thanks.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
How do you remove the increase?


Something like this would work:

Code:
a.hp = a.mhp if a.hp > a.mhp
or this, if the above doesn't work:
Code:
a.change_hp(a.mhp - a.hp) if a.hp > a.mhp
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
The increase is both added and removed via your dynamic features script. Now not on my computer for several hours but I'll test these as soon as I can.

Thanks
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Ah, okay - so you've got a script call in there somewhere. Just adding one of those commands on the next line ought to do it :)
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
Both suggestions give the following error message

Game_Interpret line 1411: NameError occurred

undefined local variable or method 'a' for

 #<Game_Interpreter:0x8b1c8147>
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Well, I gave the battle damage formula code, because I didn't know your context. a is the actor whose HP you want to change. So you could do this:

Code:
a = $game_actors[5]other command here
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
The context is the series of script calls from your dynamic features script which  remove features, specifically this one

remove_feature:)actor, 1, :param, 0, 1.05)

It's not in battle, it's when the player changes maps where the weather changes, as this is being used to create geomancy attributes.  A common event is called to either add or remove features as needed.

EDIT

Using the addition, plus the first option, works, so my system is back in operation.

Thank you.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
You'd just do this then (another method I thought of, that would also work):

Code:
remove_feature(:actor, 1, :param, 0, 1.05)$game_actors[1].hp = [$game_actors.hp, $game_actors.mhp].min
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
That brings up a NoMethodError

undefined method 'hp' for #<Game_Actors
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
Is it possible to use message codes or an equivalent within a message box via scrip call? I want to color some text.

Just for example:

$game_message.background = 1
$game_message.position = 0
$game_message.add("Not enough \C[6]Spirit\\C[0] or \C[6]Mana\\C[0]!")

This, would of course, simply crash the game.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
That brings up a NoMethodError

undefined method 'hp' for #<Game_Actors
So sorry - I only just saw this.  Yeah, I forgot the array index.

$game_actors[1].hp = [$game_actors[1].hp, $game_actors[1].mhp].min@Rinobi, you have \ sometimes and \\ sometimes.  Try one of them, and if it doesn't work, try the other one.  But make them consistent throughout the entire message.

Also, when you say "crash the game", at least give us the error message it gives you.  Otherwise we can only guess what it is.
 
Last edited by a moderator:

varchild4

Veteran
Veteran
Joined
Nov 13, 2015
Messages
30
Reaction score
3
First Language
Francais
Primarily Uses
I made a boulder and switch puzzle. When the boulder is standing on the switch it opens a door. It was successful using variables to check the position of boulder (35,28) but i wanted to simplify the event cause their will be many of those. I don't want to use variables for each one.

  • I tested with player and it works. I've put this scipt in the conditional branch:        $game_player.x == 35 and $game_player.y == 28

  • But with the bouler (EVO21) it doesn't work. I've put this scipt in the conditional branch instead:         $game_map.events[021].x == 35 and $game_map.events[021].y == 28 



Do you know why? Thanks a lot :)

Here's a sceenshot of the event: 

 
Last edited by a moderator:

Nikitaw99

Pixelmancer
Veteran
Joined
Nov 5, 2015
Messages
30
Reaction score
35
First Language
Russian
Primarily Uses
RMMV
I have A question: How Do I make messages appear on screen?

I am trying to do 

Toodles.meowBut nothing is happening.

Here's the "Script":

class Cat < Animal def meow print "Meow!" endend(And yeah, that's only the part of the script :p  .)

So: Why doesn't "Meow!" Appear on screen?

EDIT: By the way: 

Code:
Toodles = Cat.new
 
Last edited by a moderator:

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
Maybe you want:

Code:
$game_message.add("Meow!")
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,356
Members
137,802
Latest member
rencarbali
Top