Tiles that can kill you temporarily

deveras111

Veteran
Veteran
Joined
Dec 29, 2018
Messages
39
Reaction score
5
First Language
English
Primarily Uses
RMMV
Okay, so without getting into too much detail, I am trying to work on a game mechanic where you have to ignite torches to be able to walk around. To do this I'm using Terrax Lighting to create an orb of light around a Torch. The Idea is, the tiles not within this orb that are dark can kill you. I am having trouble figuring that last part out, as I would need the dark tiles to not only instantly kill the player, but then, once a torch is lit and those tiles are no longer dark, cease being kill tiles and become safe to walk on. Another caveat is that I would need a way to do this that wouldn't slow down the game if I did it abunch of times, as there are a lot of torches on my map.

I've looked into using regions as events, and maybe setting the event to change to an event page where it no longer kills the player if a certain number of variables is met. This would mean each torch I light would add one constant to the variable that the dark tiles are connected to. In this case I would need to set up the torches and their corresponding tiles in a sequential linear way so that when you light torch 1, dark spots 1,2 and 3 that are within the light cease to be deadly because of the torch.

This seems complicated, and also doesnt seem much different from making a whole lot of events that would freeze the game. From my understanding, I need to attach a single event to a region number, and that region number will act only like that event. So lets say, I have an event. And that event is set to change to the second event page when the variable count reaches two, thus rendering the tile it is connected to harmless. Now if I use a region to replicate this event, that would mean that every single time I use this region, the tile it is on will become harmless. Which would mean if I use this region later on in the level, they will have already become harmless, even though they haven't been lit yet and are suppose to kill you. To make this work I'd have to make a new event for every set of dark spots around every individual torch which still seems complicated.

Any Ideas? I'm sorry if I've made it more complicated than it needs to be, please let me know if you have any questions, and here is a link to the plugin I'm using.
https://forums.rpgmakerweb.com/index.php?threads/terrax-lighting-system.49339/

I also apologize if this thread is in the wrong spot, I'm still new.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Tech support is for getting the maker to run, so this belongs in the support level for the maker. I'll have to assume MV as that is what is on your profile.

Moved to MV Support

 

deveras111

Veteran
Veteran
Joined
Dec 29, 2018
Messages
39
Reaction score
5
First Language
English
Primarily Uses
RMMV
Tech support is for getting the maker to run, so this belongs in the support level for the maker. I'll have to assume MV as that is what is on your profile.

[mod]Moved to MV Support[/mod]
Thank you!
 

mathmaster74

just...John
Veteran
Joined
Jun 12, 2016
Messages
285
Reaction score
193
First Language
English
Primarily Uses
RMMV
@deveras111 What you're looking to do is difficult because of the sheer number of tiles that have to act as events that toggle...or so it would seem. Consider this: Every tile that stays dark remains deadly permanently. Hence, you can paint every always dark square of the map with a region and make that region event kill on contact. 1 Event covers all those squares. Now if you control your lighting, you can determine just how many floor tiles need to have the kill or let pass toggle behavior. It's only a method of "damage control" :rolleyes: (sorry for the bad pun), but it may bring the scope of what you're trying to do within manageable reach. Hope it helps! :smile:
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Maybe just turn switch1 off than check if the player is in range of each torch event, if its near one of them, let switch1 be activated.
If at the end of the code the switch is still off, than the player is in the dark and dies.
In short you dont check for dark, you check if he is in the light.

You could reexecute the code every 30 Frames or every time the player makes a step.
You could include an extra condition for each torch event before you check the coordinates.
If switch or "self switch(scriptcommand needed)" is On than check coordinates.
To see if torch is on or not.
 

deveras111

Veteran
Veteran
Joined
Dec 29, 2018
Messages
39
Reaction score
5
First Language
English
Primarily Uses
RMMV
@deveras111 What you're looking to do is difficult because of the sheer number of tiles that have to act as events that toggle...or so it would seem. Consider this: Every tile that stays dark remains deadly permanently. Hence, you can paint every always dark square of the map with a region and make that region event kill on contact. 1 Event covers all those squares. Now if you control your lighting, you can determine just how many floor tiles need to have the kill or let pass toggle behavior. It's only a method of "damage control" :rolleyes: (sorry for the bad pun), but it may bring the scope of what you're trying to do within manageable reach. Hope it helps! :smile:
Yes thats a good Idea! I was thinking of something similar, perhaps painting the tiles that will always remain dark as death tiles, specifically just the perimeter of the torch light so as not to have to paint the whole map with that tile. But how would you suggest I go about making toggling tiles for the spots that do light up?
 

deveras111

Veteran
Veteran
Joined
Dec 29, 2018
Messages
39
Reaction score
5
First Language
English
Primarily Uses
RMMV
Maybe just turn switch1 off than check if the player is in range of each torch event, if its near one of them, let switch1 be activated.
If at the end of the code the switch is still off, than the player is in the dark and dies.
In short you dont check for dark, you check if he is in the light.

You could reexecute the code every 30 Frames or every time the player makes a step.
You could include an extra condition for each torch event before you check the coordinates.
If switch or "self switch(scriptcommand needed)" is On than check coordinates.
To see if torch is on or not.
Interesting thought, and that does sound like an efficient way to get to what I'm trying to do, however I am not very versed with scripting at all so a lot of what you said just went over my head ;_;. Any ideas on how I could learn a way to do it simply, or perhaps maybe a tutorial on basic scripting for rpg maker mv that would accomplish my goal?
 

mathmaster74

just...John
Veteran
Joined
Jun 12, 2016
Messages
285
Reaction score
193
First Language
English
Primarily Uses
RMMV
@deveras111 Good question. You got me rethinking my last answer a tad bit, too. What if...call me crazy because...I am :dizzy:...but, what if you DIDN'T actually toggle the tiles on the map? What if you seamlessly changed maps? Example: Make only one square available adjacent to a "torch event" so when the player approaches the torch event and activates it, they transfer in the same facing to the same coordinates of a copy map. A copy map that has one small difference...the torch is now on and the tiles lit up by it are no longer painted as "always death" tiles. All it takes to keep up the illusion is a Transfer Player Event Command with Retain Facing to the same square they'd have to stand on to activate the torch by your design. That's just one idea. It may seem like it would take a lot of map copies, but each copy would have minor edits around the "next torch lit up". Otherwise, and this is the less crazy original way I was thinking of...staying on the map, you'd have each "torch event" throw a switch when "lit" (you can set switches using event commands in the editor, so no need to code this) and that switch would be what the corresponding "toggle death tiles" look to for their condition to deactivate...swapping out as regular tiles. Thoughts? :popcorn:
 

deveras111

Veteran
Veteran
Joined
Dec 29, 2018
Messages
39
Reaction score
5
First Language
English
Primarily Uses
RMMV
@deveras111 Good question. You got me rethinking my last answer a tad bit, too. What if...call me crazy because...I am :dizzy:...but, what if you DIDN'T actually toggle the tiles on the map? What if you seamlessly changed maps? Example: Make only one square available adjacent to a "torch event" so when the player approaches the torch event and activates it, they transfer in the same facing to the same coordinates of a copy map. A copy map that has one small difference...the torch is now on and the tiles lit up by it are no longer painted as "always death" tiles. All it takes to keep up the illusion is a Transfer Player Event Command with Retain Facing to the same square they'd have to stand on to activate the torch by your design. That's just one idea. It may seem like it would take a lot of map copies, but each copy would have minor edits around the "next torch lit up". Otherwise, and this is the less crazy original way I was thinking of...staying on the map, you'd have each "torch event" throw a switch when "lit" (you can set switches using event commands in the editor, so no need to code this) and that switch would be what the corresponding "toggle death tiles" look to for their condition to deactivate...swapping out as regular tiles. Thoughts? :popcorn:
That is quite the crazy idea, very unique though. I thought about this for a while, and came to the conclusion that it might hurt more than help. I am going to have some +100 lights, which would mean I would need +100 maps to be able to do it this way. My concern is that that would also cause the game to freeze or glitch, and since I am thinking of going commercial it opens up the question on how that effects the size of the game file. This method also presents problems for any boss battles that I would want to make that incorporate the death tile toggling mechanic. Changing maps while fighting a monster on the map would be very difficult to appear seamless (I will not be using the typical rpgmaker battle system.)

As for the common switch suggestion, that is something I am having particular trouble with. This solution would work perfectly if I was using common switches to toggle death tiles on/off a handful of times. However in reality, basically my whole game is based on turning torches on to be able to move foreward :kaosigh: So I would need to make a new switch everytime I wanted to make a new torch with corresponding toggling death tiles, which would result in well over 100 different switches being used. This is quite the predicament. :(

For a while there I tried thinking of a way to merge these two ideas. Perhaps I wouldn't need to change maps every time I lit a torch. Perhaps I could just use the common switch method for a while until I reached a certain amount (say 30 switches or so) and then I would seamlessly transition the player to another map and start the process over again. Unfortunately, I'm afraid common switches carry over to other maps, so when starting a new map I will still have 30 or so already assigned common switches, making it pointless to switch to another map in the first place.

Keep those ideas comming though! :D
 

mathmaster74

just...John
Veteran
Joined
Jun 12, 2016
Messages
285
Reaction score
193
First Language
English
Primarily Uses
RMMV
@deveras111 Okay. I'm confused when you say:

common switches carry over to other maps
If your switches are set on the torch events, which are not common events but map events, then they won't transfer maps. Also, if a switch was used on a previous map but its effects are no longer evident on this map, then you can technically go back to using that switch again on the map you're on as a toggle device and no player would know the difference, so you can limit your switch count. Example: On map 1, torches light and toggle death tiles off as torch event switches get set to ON. On map 2, torches light and toggle death tiles off when the same switches get set to OFF. On map 3 and every odd map going forward...it's ON. On map 4 and all evens going forward, it's OFF. Switches aren't really the problem anyway because you can have a ton of them in your project. I have over 180 in one of mine. The problem is keeping the event count to a manageable number. You are allowed 999 events (minus your amount of common events) per map. That's actually a fairly liberal amount too considering the visible portion of any map on screen is the 17 x 13 square grid the map maker likes to default to. 17 x 13 = 221 squares visible on screen. Subtract 1 for the player character, and then subtract a slew more that are "out of bounds" and/or permanent death tiles marked by regions, and with the number of events you have left you can scroll the screen more than 4 times over before you need to switch maps and start your event count anew there. Making a ton of identical "toggle death tile" events may sound daunting, but Yanfly has an event copy plugin you could use to make one working "prefab" toggle death tile, and then using his event copy functionality you would just keep pasting the rest and all will work identically. That may sound like no big deal because you can copy and paste events with Ctrl-C and Ctrl-V, but his plugin makes it possible to just make updates to the "prefab" and have the updates apply to all copies...so if you discover you set the prefab up incorrectly after all the copies are made, you can just fix it and update the rest and you don't have to go all the way back over every one making updates individually. For your project I'm sure that will be a lifesaver! Concerning the boss battles...you make a boss battle happen when you're scrolling to a new map. Make a short lead in to the boss room and now instead of scrolling through 4 screens worth of torch events and toggle tiles, you can put a bunch in the boss room to your heart's content. How is that sounding to you? Let me know. I want to make sure you've got the gist. :smile:
 

deveras111

Veteran
Veteran
Joined
Dec 29, 2018
Messages
39
Reaction score
5
First Language
English
Primarily Uses
RMMV
@deveras111 Okay. I'm confused when you say:



If your switches are set on the torch events, which are not common events but map events, then they won't transfer maps. Also, if a switch was used on a previous map but its effects are no longer evident on this map, then you can technically go back to using that switch again on the map you're on as a toggle device and no player would know the difference, so you can limit your switch count. Example: On map 1, torches light and toggle death tiles off as torch event switches get set to ON. On map 2, torches light and toggle death tiles off when the same switches get set to OFF. On map 3 and every odd map going forward...it's ON. On map 4 and all evens going forward, it's OFF. Switches aren't really the problem anyway because you can have a ton of them in your project. I have over 180 in one of mine. The problem is keeping the event count to a manageable number. You are allowed 999 events (minus your amount of common events) per map. That's actually a fairly liberal amount too considering the visible portion of any map on screen is the 17 x 13 square grid the map maker likes to default to. 17 x 13 = 221 squares visible on screen. Subtract 1 for the player character, and then subtract a slew more that are "out of bounds" and/or permanent death tiles marked by regions, and with the number of events you have left you can scroll the screen more than 4 times over before you need to switch maps and start your event count anew there. Making a ton of identical "toggle death tile" events may sound daunting, but Yanfly has an event copy plugin you could use to make one working "prefab" toggle death tile, and then using his event copy functionality you would just keep pasting the rest and all will work identically. That may sound like no big deal because you can copy and paste events with Ctrl-C and Ctrl-V, but his plugin makes it possible to just make updates to the "prefab" and have the updates apply to all copies...so if you discover you set the prefab up incorrectly after all the copies are made, you can just fix it and update the rest and you don't have to go all the way back over every one making updates individually. For your project I'm sure that will be a lifesaver! Concerning the boss battles...you make a boss battle happen when you're scrolling to a new map. Make a short lead in to the boss room and now instead of scrolling through 4 screens worth of torch events and toggle tiles, you can put a bunch in the boss room to your heart's content. How is that sounding to you? Let me know. I want to make sure you've got the gist. :smile:
That makes sense! I don't really fully understand how setting a switch to a torch event would be different than a common event as I am new-ish to rpg maker and I don't have my laptop right now to see what you mean, but I will take your word for it that there is a way to set switches specifically to torch events!

Also that is a good idea on using the same switches on different maps! I didn't know I could have 999 events per map, thats crazy. But would you happen to know how many simple events I would need to have for the game to start acting buggy? I remember reading on one of these forums that after a certain number the game project will act slow when launched. Whatever the case may be, using a set number of switches and alternating their usage between off and on is a great way to make what I am trying to do easier!

That plugin sounds like something that would help greatly, do you know what its called, or the link of it? And do you perhaps know if I can make a ton of events based on the "prefab" while still having those individual events have unique tags, such as the tag required for turning off and on a light in Terrax lighting? As far as the boss battle is concerned, that makes sense!

Thanks for all your help!
 

mathmaster74

just...John
Veteran
Joined
Jun 12, 2016
Messages
285
Reaction score
193
First Language
English
Primarily Uses
RMMV
@deveras111

a way to set switches specifically to torch events
Once the torch event is made, you simply double-click to start a new line of code. On the Event Commands window that pops up, make sure you're on tab 1 and select Control Switches. This brings up a pop-up window called Control Switches. Make sure Single is selected, and click the button to its right. You will get a Switch Selector pop-up window. Select a number on the right-hand side to choose that switch for the command you're working on. If there's no name for the switch, then feel free to swing down to the Name: field toward the bottom of the window and type in a name for the switch like FirstTorch. What you type should copy above next to the number you had selected. Now click OK. You will return to the Control Switches window and ON is usually selected by default. You can switch the setting to OFF if you like so the first map's events will all require switching their switches to ON. Click OK and the line of code for the event's switch will be set in the event. Congratulations! You have your map 1 prefab! :wink:

would you happen to know how many simple events I would need to have for the game to start acting buggy?
Honestly, no. However...I do have some good news. I recently released a commercial game made in RPG Maker MV and the first map is the standard 17 x 13 size, yet has 44 events that update using 44 other events, plus there are 6 parallel events that call 6 common events, so...that's 100 events on the screen all at once and the game runs smooth. What you're trying to do is a way simpler toggle. I think you'll be fine.

That plugin sounds like something that would help greatly, do you know what its called, or the link of it?
http://yanfly.moe/2018/07/06/yep-168-event-copier-rpg-maker-mv/

And do you perhaps know if I can make a ton of events based on the "prefab" while still having those individual events have unique tags, such as the tag required for turning off and on a light in Terrax lighting?
The copier won't produce unique tags automatically, but setting a unique tag in roughly 100 torch events would be like copy/paste then change a few characters and move on to the next torch. A bit tedious, but games do take work to make, after all. I'm familiar enough with Terrax lighting to tell you that yes, you can set the tags you need this way and it should work in theory. I don't know the Terrax lighting limitations for how many events it can handle or how processor intensive it gets, so I don't know if you will hit snags or need more inventive workarounds or not.

Thanks for all your help!
You're welcome! Glad to be of service. :biggrin: Keep me posted if you need anything. I'll mark the thread as watched.
 

deveras111

Veteran
Veteran
Joined
Dec 29, 2018
Messages
39
Reaction score
5
First Language
English
Primarily Uses
RMMV
@deveras111



Once the torch event is made, you simply double-click to start a new line of code. On the Event Commands window that pops up, make sure you're on tab 1 and select Control Switches. This brings up a pop-up window called Control Switches. Make sure Single is selected, and click the button to its right. You will get a Switch Selector pop-up window. Select a number on the right-hand side to choose that switch for the command you're working on. If there's no name for the switch, then feel free to swing down to the Name: field toward the bottom of the window and type in a name for the switch like FirstTorch. What you type should copy above next to the number you had selected. Now click OK. You will return to the Control Switches window and ON is usually selected by default. You can switch the setting to OFF if you like so the first map's events will all require switching their switches to ON. Click OK and the line of code for the event's switch will be set in the event. Congratulations! You have your map 1 prefab! :wink:



Honestly, no. However...I do have some good news. I recently released a commercial game made in RPG Maker MV and the first map is the standard 17 x 13 size, yet has 44 events that update using 44 other events, plus there are 6 parallel events that call 6 common events, so...that's 100 events on the screen all at once and the game runs smooth. What you're trying to do is a way simpler toggle. I think you'll be fine.


http://yanfly.moe/2018/07/06/yep-168-event-copier-rpg-maker-mv/



The copier won't produce unique tags automatically, but setting a unique tag in roughly 100 torch events would be like copy/paste then change a few characters and move on to the next torch. A bit tedious, but games do take work to make, after all. I'm familiar enough with Terrax lighting to tell you that yes, you can set the tags you need this way and it should work in theory. I don't know the Terrax lighting limitations for how many events it can handle or how processor intensive it gets, so I don't know if you will hit snags or need more inventive workarounds or not.



You're welcome! Glad to be of service. :biggrin: Keep me posted if you need anything. I'll mark the thread as watched.
I will! You've been very helpful!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:

Forum statistics

Threads
105,883
Messages
1,017,236
Members
137,608
Latest member
Arm9
Top