RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[XP] Conditional Branch Script for checking if Always On Top or Through Enabled?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 70
RMRK Junior
Hoping you guys can help me.  I have need for a Conditional Branch that needs to check whether or not some of the resources not available in the Conditional Branch options are enabled or not.  Basically, "if Event.Through == True" or "if Event.Always_On_Top == 1" or something like that.

Can you help me out?
Heretic's Vehicles XP (Boat and Magic Carpet)

Heretic's Collection XP Ver 2.3 - Updated to include Dynamic Lighting, Moving Platforms, Vehicles, and much much more!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, I suspect that there is a better way to do whatever it is you are trying to do by checking those values.

However, you can check if an event is through by placing the following code into the script field of the conditional branch:

Code: [Select]
$game_map.events[event_id].through

where event_id is an integer corresponding to the ID assigned to the event you are checking.

always_on_top is not, by default, publically accessible, so you will need to first insert a new slot in your scripts, and in that, paste the following:

Code: [Select]
class Game_Character
  attr_reader   :always_on_top
end

Then, in the script field of the conditional branch, check the following:

Code: [Select]
$game_map.events[event_id].always_on_top

where again, you replace event_id with the integer ID for the event you are checking.

If you want to check either of those values for the player, then the code is:

Code: [Select]
$game_player.through
$game_player.always_on_top

***
Rep:
Level 70
RMRK Junior
I never would have figured that out!  I tried reading through the pages of the engine I thought were relevant, but apparently got totally stuck on through and always on top not being public.

I am so glad there are people like you that both understand the engine to this degree and are willing to help!  Thanks a ton!
Heretic's Vehicles XP (Boat and Magic Carpet)

Heretic's Collection XP Ver 2.3 - Updated to include Dynamic Lighting, Moving Platforms, Vehicles, and much much more!