Script Call Support Boards

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.
$game_map.tileset.id
Perfect. Thank you.
Judging by how this

d1a8005443f934d8cf4f769c9e2433f8.png


and this

8359fc607829e3a52d0d3b416d4d2be0.png


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.
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.
Ok. I didn't think that this was worth its own thread so i refrained from starting a new one.
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.
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
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
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 🙂
Both suggestions give the following error message

Game_Interpret line 1411: NameError occurred

undefined local variable or method 'a' for

 #<Game_Interpreter:0x8b1c8147>
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
The context is the series of script calls from your dynamic features script which  remove features, specifically this one

remove_feature🙂actor, 1, 😛aram, 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.
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
That brings up a NoMethodError

undefined method 'hp' for #<Game_Actors
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.
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.
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: 

[IMG]http://snag.gy/kIzSk.jpg[/IMG]
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 😛  .)

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

EDIT: By the way: 

Code:
Toodles = Cat.new
Maybe you want:

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

Original thread: https://forums.rpgmakerweb.com/threads/script-call-support-boards.25767/