LINE OF SIGHT PLUGIN

Allows you to detect line of sight between points and events.

  • Kazesui
  • 05/04/2014 04:34 PM
  • 8744 views
This Plugin allows you to determine if the hero, and event or simply a point can see any of the mentioned with a simple comment command.

Basically, you select a comment command, based on what is suppose to see what, for example if hero sees and event, feed it with parameters as to how far and wide the range of sight should be and a switch. If the switch is turned on, then the target was within the line of sight, and if not, then it's outside the line of sight.

The plugin detects unpassable terrain, and consider them to be such that they cannot be seen through. Events however will be seen through, regardless of being same level as hero or not. At the moment, the plugin also cannot see into the upper part of a wall autotile properly. There are also a few other minor cases, where the line of sight will fail, but overall, it should work fairly well for now.
Will probably be updated sometime in the future to mend these tiny issues



Current Version: 1.01

Details

  • 853.7 KB
  • 353
  • 03/17/2024 01:01 AM

Actions

Posts

Pages: 1
I'm having a strange issue with this plugin.

I setup an event like this:



And it works. It shows a picture that says "Push" when you are in an adjacent tile to the event in question. However, something else happen. Switch 142 turns ON, which kills enemy #2.

I made changes to make sure it was this event that was causing it. I used the find function to see every event that references switch 142 and there were only a few and they aren't causing the problem. I used a different trigger switch.

The event in the picture is a side event tracking the pushable object. So at first I had event ID 58, the event that you can push. Then I changed it to event 48, which is the event in the picture, and the same problem happens.

What the hell??

edit: It seems like this error only happens when the event is set to parallel process. All I did is switch it to Action Key and it doesn't affect switch 142 when it shows the picture. But I need it to work on parallel.
There's nothing in the source code which could imply such an error, and I also cannot reproduce your problem. Are you sure that switch 1523 does not activate anything else (or your variables for that matter)?
author=Kazesui
There's nothing in the source code which could imply such an error, and I also cannot reproduce your problem. Are you sure that switch 1523 does not activate anything else (or your variables for that matter)?
Yeah, the whole group of 20 switches were blank and I use them only for the LoS plugin. It was on 1522 at first and called "Enemy 1 sees you". I had been using it for something else (not related to killing any enemies). I even changed it to 1523, which was blank, as a test which is what you see in the image now. There is zero chance that this switch is connected to any of the code that controls enemies dying.

I've tried moving the LoS event to another map and it doesn't happen there. But I've checked all the sw's and var's involved in the problem and I don't see anything in conflict. Thing is this problem is happening in the map I'm using as my template for every new map, so I really only need it working on this map. The other map I tried it on was my previous general test map. I took that map and started removing all the events that won't be needed on every single map. I didn't change anything else, so they are basically identical maps only the newer one has less events. Nothing to explain why this is happening. I just tried this again, and even on the other map it's causing the enemy to die.

If I send you the project do you think you could find the problem through some kind of debug program?

I'm still working on figuring it out. It looks like the culprit is that the enemy health variable, var8, is being given a value of 12. It's hp is 10, so since var8 is over 10 it triggers his death events. I've looked up all the events that alter var8 and nothing is in conflict. As far as I can see and remember, none of them should be dealing 12 damage anyways. I even put message commands in the usual events that cause a change to var8 but none of them are triggering. I put messages in the LoS event and it happens right away when whatever switch I indicated in the @... command is turned on. I've tried several different blank unused switches and they all cause this to happen so all signs point to a plugin issue.

I recently updated to the latest dynRPG version. The one that fixes transparency.

I even tried the other commands like @hero_see_event. I can create an event that is only this "@hero_see_event 1522, 55, 100, 55" and as soon as I step in the line of sight it changes variables. After a few more tests, it seems like it's not even doing the same thing each time. I now notice that it's changing var 9, sword strength, to sometimes 9 10 or 11. Then it's triggering the series of code that normally happens when you hit the enemy with your sword, which I confirmed with a message command is not actually running. Var8, enemy 2 HP, gets the value of var9, sword strength, added to it. So however much dmg your sword is supposed to deal gets added to enemy HP, when that damage is greater than it's max HP it dies. That's determined by a precondition on the event page of var8 equal/greather than 10. That's what get's triggered and it's bypassing all the event code and common event code that normally handles it.

I can even increase the switch array by 1, use that newly added switch, and this issue still occurs.

Unlike what I mentioned earlier this happens on Action Key, Hero touch, parallel process. All of them.

xD I'm running out of ways to prove that it's a plugin issue. It may have to do with the size of my game and the combination of plugins. You might not be able to recreate it with a new project that only has the LoS plugin.
it could be a problem with the latest dynRPG version. It would sound a bit odd still though, especially for your variable trouble, seeing how the plugin doesn't even access any variables. If you send me the project along with some instructions about relevant events and stuff, I might be able to figure it out though, or at least speed up the process of figuring out the problem.
I seem to be having an issue with this plugin as well, specifically with the "@event_see_event" command.

Basically, I have a scenario where one of your party members disguises as a guard, and the others have to try to escape. You can switch between the two, and there's a "Player2" event that switches its graphic to the party leader or the member dressed as a guard, whatever the player currently isn't controlling.

I wanted the guards to be able to be spoken to while playing as the member disguised as a guard, but still be able to do the line of sight check. So that meant I couldn't have the guard event be a parallel process and use the "@this_see_X" command, because I wouldn't be able to talk to him.

So, instead, a made a separate invisible event that used the @event_see_hero and @event_see_event. @event_see_hero works just fine, but @event_see_event is where I'm having issues. It doesn't detect the "Player2" event when it is the escaping party's graphic, and for some reason it only triggers when I speak to the guard from the OPPOSITE direction, and then the guard turns around to face where the Player2 event is. It triggers the switch once (its supposed to loop) and I'm not sure why it's not working. It's hard to explain in words, so I can provide pictures if necessary.
The @event_see_event bug should now be gone
I received an access violation using this plugin with dynrpg .20

"Access violation in module "KazeLoS.dll" in with address 6EC0300E and offset 0000001D of type Read occured."
Do you know which command caused the access violation?
@event_see_hero "1241", "3", "90", "100"

That's the one

EDIT:

... I am a hopeless fool. Removing the quotations solved the problem. Sorry for bothering you about that.
Pages: 1