Sensor SelfSwitch

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
So working on my demo, I noticed that a few improvements should be made.

Each Note block is a different change that will be coming in the next version.

A lot of the functionality changes from these. As I see it, only for the better.

 

Note 1:


An option for which way the sensor should face would be beneficial. As working with something like, damage sprites and whatnot, wouldn't really yield a good indicator of direction.

There are ways around this, but for simplicity's sake I think I'll be adding an optional parameter to the tags, DLRU or Down Left Right Up. They can be spelled out or shorthanded to 1 letter, and must be placed after the last number, but before the >

Ex: 

<SensorLV: 3, Left>

<SensorLV: 3, L>

This cannot be used with the basic <Sensor: x> tag, as that surrounds the event.



 

Note 2:


All commas will become optional, so <SensorRV: 2 3 L> will work the same as <SensorRV: 2, 3, L> or <SensorRV: 2 3, L> or <SensorRV: 2, 3 L>

The spaces are still required so the plugin can know the difference between the numbers.

This would only affect the Rectangle view, but with the addition of the direction, possibly affect any tag that isn't the basic surrounding circle tag.



 

Note 3:


To use game variables for the range/width values, place a ! directly in front of the number. This will change the number into the ID of a game variable. The value of the variable will be used for the sensor.

Ex: <Sensor: !3> will use the value of game variable 3 for the sensor range. 

     <Sensor: 3> will use 3 as the sensor range.

Please note that this is opposite to the rectangle view variable tag's old functions.

Also note, that this means there will be no more "Var" tags.

<SensorVar: x>

<SensorLVar: x>

<SensorCVar: x>

<SensorRVar: x, x>

Will be removed!

You will get an error if the value is not a number.



 


[EDIT] Note 4:


I've noticed, atleast in the rewrite I'm working on, that the selfswitch will not trigger when the player is in the sensor zone when the event changes directions, or moves.  The best fix for this does however mean that it will check the sensor zones every update cycle, instead of just when the player moves.

On the upside, It will now skip processing anything if there is no sensor information on the event OR the current page. 




 

Note 5:

I hope to be able to add plugin command support so you can change any aspect of a sensor on fly. I make no promises here, as I haven't been able to look into it just yet.

 

Update:

I've reworked much of my code, and want to take a look into reworking the sensor zone checking.

I'm sorry about the delay of the Demo, but I have this desire to make a final(ish) version to put out with it.

[/EDIT]

 

I have rebuilt my tag processing system, and I am quite satisfied. :D

Unfortunately, this halted progress on my demo for a bit.  :(

I will not be pushing this update out just yet, as I haven't been able to fully test it. Most likely the next update will accompany the demo. I'll try to keep you guys abreast of further changes and fixes planned.
 
Last edited by a moderator:

shftatsix

Villager
Member
Joined
Jun 27, 2014
Messages
10
Reaction score
5
First Language
English
Primarily Uses
Windows defender sees this download as a virus and wont let me download it from pastebin, either versions listed.

Anyone else experience this?
 

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
 

Windows defender sees this download as a virus and wont let me download it from pastebin, either versions listed.

Anyone else experience this?
I've seen this come up on other plugin threads. I can only assume its because its a .js file. 

Can you try to copy the plugin from the plain text box at the bottom of the page and put it in a text file and then change the extension of the file to .js?

Also a note about the Demo and Newest version, I am working on it, the Demo is completed, Some issues came up with my rebuild that has forced me to come up with some work arounds so that all the functionality is maintained consistently.

Apparently, maps are reloaded differently when returning from the menu, and this broke my plugin when returning from the menu.
 
Last edited by a moderator:

Prescott

argggghhh
Veteran
Joined
Aug 28, 2014
Messages
505
Reaction score
410
First Language
English
Primarily Uses
RMMV
Is it possible to use this with normal switches rather than Self Switches? If you have more than 4 guards on a map you're screwed, because this will only allow for 4 separate events on one map.
 

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
You can have as many sensor events on a map as you need. There is only 4 selfswitches per event. Meaning, each event has A, B, C, D selfswitches.
The sensor will only fire the selfswitch for the event it is tagged on. I would caution about overdoing though, as each sensor is getting checked every frame, so a lot of them could easily cause lag.
 

Prescott

argggghhh
Veteran
Joined
Aug 28, 2014
Messages
505
Reaction score
410
First Language
English
Primarily Uses
RMMV
Oh my hell. I've been using self switches wrong this whole time.
 

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
Wambajamba!

Version 3.2 is now available! What's that? Oh, Yes, there is a demo.

What was changed?

Plugin Commands to modify/add/remove sensors on the fly!

   Simply put LSensor followed by applicable properties and values, these are described in the OP and the plugin's Help.

Simplified variable usage!

   Placing ! before a number in a tag (in the range or width placements) will use the variable with that number's ID

Commas not required!

   You no longer need to put commas in tags, but you can if you want.

Rebuilt tag handling

  This one outwardly effects you very little, but it provided a much needed means to enhance bug squashing and provide the new features. 
 
Last edited by a moderator:

Unmercyful

Veteran
Veteran
Joined
Oct 25, 2015
Messages
123
Reaction score
31
First Language
English
Would like say thank you for a wonderful plugin. Works awesome! Is there a global plugin command to be able to turn the plugin on and off?
 

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
There is not. You can turn off specific sensors by using the plugin command, something like 'LSensor event id x type null' as type null will prevent a sensor from being evaluated.

Also with blackout regions using a switch you could easily blank out a whole area.

If these are insufficient I could add the plugin command to switch on/off all sensors as a function, it hadn't occurred to me before.
 
Last edited by a moderator:

Unmercyful

Veteran
Veteran
Joined
Oct 25, 2015
Messages
123
Reaction score
31
First Language
English
What ever you could do and when ever you have the time that would be awesome! I am trying to get this event   Screenshot.png  to not to react when the player is on a vehicle ( just the boat). As you can see in the screen shot I am using your plugin along with Yanfly's Event Chase, Karberus's  Simple Land Vehicle and Kocka Respawn Event plugins. They all work together well, I just can't get the event to stand still when on horseback. I hope that explains what well what I am trying to accomplish. Thank you very much for taking the time to read this and for this great plugin for us to use. I have posted a query a few days ago on the forums, but Andar's answer did not help.http://forums.rpgmakerweb.com/index.php?/topic/54769-off-vehicle-conditional-branch-option/
 

Roguedeus

It's never too late to procrastinate...
Veteran
Joined
Mar 19, 2013
Messages
532
Reaction score
107
First Language
English
Primarily Uses
N/A
v3.2 seems to have an issue regarding region blocking. Having no region defined as the block, treats blank regions as a blocking region.

v3.1.1 does not have the issue.

I was thrown for a loop when my sensors suddenly stopped working. :)
 

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
What ever you could do and when ever you have the time that would be awesome! I am trying to get this event  
Screenshot.png  to not to react when the player is on a vehicle ( just the boat). As you can see in the screen shot I am using your plugin along with Yanfly's Event Chase, Karberus's  Simple Land Vehicle and Kocka Respawn Event plugins. They all work together well, I just can't get the event to stand still when on horseback. I hope that explains what well what I am trying to accomplish. Thank you very much for taking the time to read this and for this great plugin for us to use. I have posted a query a few days ago on the forums, but Andar's answer did not help.http://forums.rpgmakerweb.com/index.php?/topic/54769-off-vehicle-conditional-branch-option/
Given what you're trying to accomplish, I would recommend using the plugin command with the 'type null' parameter to turn it off on the condition of the player being on a vehicle and the appropriate type setting to turn the sensor back on.

That said my next update will have a on/off plugin command, it was frightfully simple to add.

v3.2 seems to have an issue regarding region blocking. Having no region defined as the block, treats blank regions as a blocking region.

v3.1.1 does not have the issue.

I was thrown for a loop when my sensors suddenly stopped working. :)
That's interesting, so you don't have a value in the region block parameter?

If so, it would be evaluating with NaN and returning true for a block. I'll look into this when I get home.

[EDIT]

It is 0, not NaN. I don't think I even touched this method in my changes, weird how it worked before. I will have a fixed version up in a little while.

[EDIT2]

New version is linked in OP, Demo is updated too.

Added on/off functions for all sensors, event level sensors, and page level sensors.
 
Last edited by a moderator:

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
New Update 3.2.2!


Fixed an issue found with a plugin command.


v3.2.2 Pastebin - Demo


I will update the Main Post as soon as I can without breaking the edit toolbar.
 

Portkey89

Veteran
Veteran
Joined
Apr 4, 2012
Messages
78
Reaction score
16
First Language
English
Primarily Uses
Hi!  Firstly, this plugin is INCREDIBLE!  I've been able to have on-map spell casting by having the enemy sense if you're close when casting a spell, and then using this to have them react to the spell.  It's been awesome!


On that note: is it possible to get a version of the sensor that detects X tiles in any direction but only in straight horizontal/vertical lines so that it's always in a cross formation?  Right now, the further the radius goes with the standard sensor, you get tiles that are not in a direct line, creating a sort of circle radius.  And the LV sensor works in a straight line, but only works in the direction the event is facing.  Wondering if possible to get a sensor that works like LV, but that doesn't matter where the event is facing, for those events without a face. ;)   Thanks so much!  So happy with this plugin!!!!!!
 

Roguedeus

It's never too late to procrastinate...
Veteran
Joined
Mar 19, 2013
Messages
532
Reaction score
107
First Language
English
Primarily Uses
N/A
... I would caution about overdoing though, as each sensor is getting checked every frame, so a lot of them could easily cause lag.


@Lyson I am wondering... Is the sensor only being checked if the event itself is within the default event activation range? Such that normal events go inactive when more than a few steps outside of the players view. Or are all sensors getting checked regardless of where they are in relation to the player?


If (due to the 'distance' sensing) each sensor is checked each frame, regardless of its location, could I request a means of disabling that in a plugin parameter? Along with an exception flag for the few events that will sense regardless of distance?
 

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
@Portkey89 


I can look into this, I'll get back about this next week.


@Roguedeus


This is a great thought for optimization!


I'm not entirely sure how the system handles events that are out of the viewport. I'll do some testing and see what I can turn up and change.


Edit: I just ran a quick test, at more than 10 tiles off screen, the sensor was still being checked. However, with 100 rectangle view, and 100 cone view sensors, there was no lag. I'll be looking into being able to deactivate sensors when off screen, with exception flags, as I do feel this is a great idea.


There could still be a performance hit with combining a large number of sensors with many active events (moving and such) on a large map.
 
Last edited by a moderator:

Roguedeus

It's never too late to procrastinate...
Veteran
Joined
Mar 19, 2013
Messages
532
Reaction score
107
First Language
English
Primarily Uses
N/A
@Lyson


Yeah, I did some testing as well. It seems that the overhead added by sensors is rather minimal when compared to the way that events themselves are updated. So spending time trying to minimize your plugins impact would likely be a waste. The majority of potential lag is due to the default MV code. There is ZERO optimization. Which isn't normally a problem with small to medium maps with a few hundred events.


Its when events get upwards of 300+ that FPS starts to suffer. (On mid range PC's. Likely worst for mobile and low end PC's)


I've come to the conclusion that I will have to cut up my main map. Its less than 30% complete and already has nearly 300 events.


So... I have a lot of work to do. :(
 

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
@Roguedeus


It seems that not only is it a waste, but creates even more overhead. There isn't any aesthetic appeal to this either, so yeah, scrapped.


RPG Makers' have had a lag related soft cap on events for a long while. I'm actually kind of surprised ~300 would be the limit and not less.


I read up on your project Prequel, ambitious and promising, I will enjoy delving into it when its finished.  :popcorn:


@Portkey89


Just a little update, I've come up with how to go about your idea in a flexible way, multiple directions for directional sensors. Tag/Plugin commands would be the same as always but you can have as many directions applied as you desire.


Ex:


<SensorLV: 4 dlru>


<SensorCV: 2 up left>


I can't guarantee something will be out this week as my work schedule is changing, but I'll do what I can. 
 

Portkey89

Veteran
Veteran
Joined
Apr 4, 2012
Messages
78
Reaction score
16
First Language
English
Primarily Uses
Genius!  Thank you so much; I look forward to it. :)
 

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

Latest Threads

Latest Profile Posts

Got a nice little platform coming along backwards compatible with MV.
I'm so amazed at this ABS plugin for MV. This is a plugin that can literally fulfill my biggest game dreams, creating an Ultima VII-like game. Below is a video of a quick scenario I created to test out the plugin. The music in the video is my own composition.

The MZ Steam discussion board is filled with so much whining. Glad I never have to go there, or to any Steam discussion board. Anyway, here's something awesome:
I've been meaning to create a better trailer for my game but it takes time, so for now all I got is the same old trailer with updated footage:

Forum statistics

Threads
100,658
Messages
978,165
Members
132,273
Latest member
Tihn
Top