Sensor SelfSwitch

DavidFoxfire

Veteran
Veteran
Joined
Feb 28, 2014
Messages
224
Reaction score
44
Primarily Uses
I have Version 3.1 and I'm still getting problems...

/C:/Users/David/...../Baldursgate/js/plugins/Sensor%20SelfSwitch.js:153

Uncaught TypeError: Cannot read property 'parameters' of undefined

This might be something to do with MV Commons.  I have the filename be "Sensor SelfSwitch.js", by the way.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
First Language
indonesian
Lyson... you forget adding <Sensor SelfSwitch> in this:

 * @plugindesc Allows events to flip a self switch when a

 * player is in range.

 

change it to:

 * @plugindesc Allows events to flip a self switch when a
 * player is in range. <Sensor SelfSwitch>


or if you don't want it to show...

 * @plugindesc Allows events to flip a self switch when a
 * player is in range.

 * <Sensor SelfSwitch>

 

Code:
Lyson.Parameters = $plugins.filter(function (plugin) { return plugin.description.indexOf('<Sensor SelfSwitch>') != -1; })[0].parameters;
will search plugin that have <Sensor SelfSwitch> in the plugin description

 

that's why now when even the name is right it still won't detect the parameter.
 
Last edited by a moderator:

Dallas Robinson

Villager
Member
Joined
Oct 29, 2015
Messages
45
Reaction score
1
First Language
English
Sigh, yeah this script seems like it's exactly what i need but i don't understand why i (and so many other people) are having trouble getting it to work even after renaming it. I'm sorry but you might have to walk us through it or make an example project. I thought it was just me but yeah others are having the same issues
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
First Language
indonesian
Sigh, yeah this script seems like it's exactly what i need but i don't understand why i (and so many other people) are having trouble getting it to work even after renaming it. I'm sorry but you might have to walk us through it or make an example project. I thought it was just me but yeah others are having the same issues
currently this plugin cannot work because the plugin cannot get the parameter. it's because Lyson forgot adding something in the plugin description...

we can wait for him to fix it... or... if you're not patient... open the js file using notepad

then search this line at the TOP of the plugin:

 * @plugindesc Allows events to flip a self switch when a * player is in range.change it to:

 * @plugindesc Allows events to flip a self switch when a * player is in range. <Sensor SelfSwitch>then save it...

Lyson probably busy and didn't see this thread.... but he will fix it for sure. :D .

for the mean time... you can try editing like above. hope this help.
 
Last edited by a moderator:

Nova Toby

Veteran
Veteran
Joined
Mar 14, 2012
Messages
31
Reaction score
7
First Language
English
Primarily Uses
I kept getting a Type Error Cannot read propertys 'list' of undefined. It would freeze the game if I tried moving on any map other than the one I loaded up. 

It was to do with this Sensor Self Switch plugin. After messing around with it I found it only worked if I turned off MVCommons. Anyone else get this?
 

DavidFoxfire

Veteran
Veteran
Joined
Feb 28, 2014
Messages
224
Reaction score
44
Primarily Uses
currently this plugin cannot work because the plugin cannot get the parameter. it's because Lyson forgot adding something in the plugin description...

we can wait for him to fix it... or... if you're not patient... open the js file using notepad

then search this line at the TOP of the plugin:

 * @plugindesc Allows events to flip a self switch when a * player is in range.change it to:

 * @plugindesc Allows events to flip a self switch when a * player is in range. <Sensor SelfSwitch>then save it...

Lyson probably busy and didn't see this thread.... but he will fix it for sure. :D .

for the mean time... you can try editing like above. hope this help.
This quick fix worked for me, thanks estriole :)

One less thing to worry about.
 

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
I'm so sorry guys, My computer with all my rpg maker stuff refuses to stay on, so I end up trying to rush my updates.

I'm trying to move stuff over to my laptop so I can fix and help out. It's not the most reliable either, but at least it should stay on as long as I have it plugged in.

@estriole,

I'm not sure what happened there, I had that line there, and tested it. With my computer acting up, I can only assume I goofed when recovering from the crash, and didn't recheck that I was looking at the right file.

This is embarrassing, but I have updated the pastebin with the name in the description.  If for some reason it's still missing, please PM, as that should send me an email.

I believe I have something funky going on with the blackout region switch, when I can I will be trying to test that extensively and fix anything that may be wrong.

Also I'll be making a demo that shows off various functions, but the plugin will really only be limited by how you can think to apply it.

Again, My apologizes while I try to get things in order.
 
Last edited by a moderator:

Dallas Robinson

Villager
Member
Joined
Oct 29, 2015
Messages
45
Reaction score
1
First Language
English
it's okay dude! i'm just happy you made the script and your willing to look into problems. I'm very grateful.  3.1 seems to work a little smoother on my end though i can't get it to fully work. On my side it just doesn't trigger the self switch unless i walk right on top of the event no mater how big I make the 'line of sight' in the event note field. I think for me being able to open up an example project is the best way for me to 'get it' so i look forward to you uploading one :)
 

Dallas Robinson

Villager
Member
Joined
Oct 29, 2015
Messages
45
Reaction score
1
First Language
English
HAZZZZZAH! I GOT IT TO WORK! I'm so freaking happy! I don't know if this is a bug of not but when i kept on plugging in <SensorLV: 4> into the event note it wouldn't trigger but when i made it a comment IN contents the event it would! after some more tinkering I found that triggering the script via a comment is much more stable for some reason. I will mess around with it some more and do make that sample project but yeah, seems to work so far. 
 

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
That's very curious. The line view in my video was an event note tag. The comment tags are checked after the event note tags, so I'm not surprised that they would be more effective.

I should be able to finish my demo next week. I'm trying to think of different ways to use the script. I'm very interested to see if I run into any problems like that.

Alternatively, if you use a Rectangle view, with the width as 0 it works just like line view.
 
Last edited by a moderator:

Vallar

Veteran
Veteran
Joined
Jun 10, 2014
Messages
106
Reaction score
12
First Language
Not English
Primarily Uses
Hello, 

Thank you very much for the plugin. I am however having trouble getting it to work -- sorry. 

I have done exactly as mentioned; I named it as you guys said (even though the posts suggest that the issue was resolved) just in case. I have a clean first page event sheet and the second one has a simple message. The event isn't moving even. I am using the note <SensorCV: 3> but nothing is working. Here is the setup below:

  http://imgur.com/a/F2Y1U

Any help would be appreciated. 

Thank you very much in advance.
 

Dallas Robinson

Villager
Member
Joined
Oct 29, 2015
Messages
45
Reaction score
1
First Language
English
well, you can do what i did. don't use the note area for <SensorCV: 3>. go into the contents of page one and make a comment with the line <SensorCV: 3>. that's what made it work for me.
 

Vallar

Veteran
Veteran
Joined
Jun 10, 2014
Messages
106
Reaction score
12
First Language
Not English
Primarily Uses
well, you can do what i did. don't use the note area for <SensorCV: 3>. go into the contents of page one and make a comment with the line <SensorCV: 3>. that's what made it work for me.
The weird thing is that I tried with comments and it didn't work; when I set the 1st page to Autorun the whole game freezes (with the comment method). If I change it to Parallel the game runs but the plugin doesn't work. Not sure what is wrong really.
 

Dallas Robinson

Villager
Member
Joined
Oct 29, 2015
Messages
45
Reaction score
1
First Language
English
oh, I can tell you how i'm using it for my game. I have really simple MetalGearSolid guards. They do one action if they see you (rush and attack), but if the player touches them in another (not the front) way they  are "knocked out".
I have cameras that when they see you they trigger different behaviors on other events. AKA the guards are alerted and  go to that area but still retain the "if i see you i will attack" 

I have line of sight for door puzzles, alarms, and also for Proximity mines (step in the general area and take damage) 

the great part is that you can keep the pages REALLY SIMPLE with your script and have two behaviors on a page with only about 3 lines.

after using it for a while i will note that it would be nice to have the line of sight ignore some tile labels (like any tile surface painted with the number 10) this way you can do things like "the player is hidden in shadow"  so guards can't see them.  

But yeah. it's a very powerful simple script that basically opens up a lot of play stealth mechanics :). the only negitive i have found is not being able to visually represent the area of sight for the player in a simple way. (like a flash lite or scan lines) but that's a small thing.
 
Last edited by a moderator:

Dallas Robinson

Villager
Member
Joined
Oct 29, 2015
Messages
45
Reaction score
1
First Language
English
The weird thing is that I tried with comments and it didn't work; when I set the 1st page to Autorun the whole game freezes (with the comment method). If I change it to Parallel the game runs but the plugin doesn't work. Not sure what is wrong really.
Hmmm, interesting. just to make sure are you running the 3.1 script? also to make sure i had no conflicts i deleted out the plug in from the plug in directory and the menu and hooked it all up again from scratch. that cleared up some things for me as well. 3.1 doesn't need you to rename anything
 

Vallar

Veteran
Veteran
Joined
Jun 10, 2014
Messages
106
Reaction score
12
First Language
Not English
Primarily Uses
Well that was interesting. Disabling all plugins made it work with comments. I hope this gets fixed as it would be wonderful if it worked with Quasi's Pixel Movement plugin for example or the Map Exporter.

Thanks for the tip though. :)
 

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
after using it for a while i will note that it would be nice to have the line of sight ignore some tile labels (like any tile surface painted with the number 10) this way you can do things like "the player is hidden in shadow"  so guards can't see them. 
Blackout region is implemented, so you can paint tiles with a region that is set in the plugin parameters. So essentially you paint region 10 on the tiles to be ignored, and set Blackout Region to 10 in the parameters.

But yeah. it's a very powerful simple script that basically opens up a lot of play stealth mechanics :). the only negitive i have found is not being able to visually represent the area of sight for the player in a simple way. (like a flash lite or scan lines) but that's a small thing.
For representation of the areas like that I would make sprite sheets for the effect, or use a lighting script. You could use an overlay for static areas.

Well that was interesting. Disabling all plugins made it work with comments. I hope this gets fixed as it would be wonderful if it worked with Quasi's Pixel Movement plugin for example or the Map Exporter.
This was not in the scope for the plugin. I don't anticipate compatibility with any pixel movement/pixel collision detection, as this works purely on the existing rpg core system. Meaning, it works by checking differences in placement on the map in relation to the tiles, and using math to narrow the areas to the proper distances/shapes. for example: If the player is less than or equal to 3 tiles away, set selfswitch. Is the tag: <Sensor: 3>

A pixel sensor would essentially be a complete rebuild, as I understand it, and may be dependent on a specific pixel movement plugin.

I'm not sure what compatibility could be needed for Map Exporter. That makes a .PNG file from the map, correct? I don't see how this would conflict, it is rather strictly linked to events, game variables, and game switches. Unless there is some sort of event purging in the creation of the image file, but it looks like it just makes a snapshot of the game.

I wanted to create a simple sensor script for use in a variety of ways, this is even more advanced than I intended when starting.

Short of solid request/suggestions for additional shapes, or maybe features for the blackout zones, I believe I'm done adding anything to this plugin. (Bug squashing isn't considered to be 'adding')

I have done exactly as mentioned; I named it as you guys said (even though the posts suggest that the issue was resolved) just in case. I have a clean first page event sheet and the second one has a simple message. The event isn't moving even. I am using the note <SensorCV: 3> but nothing is working. Here is the setup below:
It doesn't look like the event is set to move. I'm unsure what the issue could be preventing it from functioning. Can you open the console in test play (F8) and let me know if there are any errors listed in there?

Also, note that an autorun page that doesn't erase event or change to another page will halt gameplay, as the game is still trying to run the autorun, which isn't doing anything.

Be sure you guys are using 3.1.1 as I fixed a stupid mistake after putting out 3.1

I'm am really glad I've made something that people enjoy!
 
Last edited by a moderator:

Vallar

Veteran
Veteran
Joined
Jun 10, 2014
Messages
106
Reaction score
12
First Language
Not English
Primarily Uses
@Lyson, you are a genius! Thanks a lot. It works perfectly now with both the note and the comments. I have downloaded the 3.1.1 again. However this time in a clean project and it worked perfectly with both. So I went ahead into my clean project and added every single plugin I had in the original one and enabled and disabled one by one. It works with all plugins except Quasi's Movement and Collision plugin as you mentioned. 

So I just used Orange Movement plugin instead for diagonal and pixel movement and it worked perfectly. 

After that I went ahead to my old project and disabled Quasi and tried to play the game and it didn't work, so I had to disable every plugin and re-enable one by one till it finally worked with both comments and notes. :)

Thought I'd post the details just in case someone wants a similar setup as mine (pixel + diagonal movement + your notification system). Again, thanks a lot Lyson! Very well done job with this plugin!
 
Last edited by a moderator:

Lyson

Potholders!
Veteran
Joined
Sep 4, 2012
Messages
91
Reaction score
36
First Language
English
Primarily Uses
Awesome! I'm glad it worked out. 
 

Dallas Robinson

Villager
Member
Joined
Oct 29, 2015
Messages
45
Reaction score
1
First Language
English
OH! don't know how i missed the black out option. thanks for reminding me :).  as for the line of sight I'm actually using a pretty robust lighting script to handle that for now. 
 

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

Latest Threads

Latest Profile Posts

What does your project folder look like?
I was told that an iPhone can provide a personal internet hotspot...You learn something new everyday!
Will probably never use MZ. Buys it anyway
Been playing Star Ocean: The Last Hope, the remastered version on PS4. I like it. Seems others think it's garbage, but I like these cutesy, silly, and tropey characters. Having waaaay more fun with it than SO: Integrity and Faithlessness.

Forum statistics

Threads
100,458
Messages
976,161
Members
132,082
Latest member
nwr
Top