Skip to main content

News

Topic: Persons and Triggers not working (Read 4256 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
Persons and Triggers not working
So I have a map with some enemy sprites, make contact with them and combat will start.
The problem began when I was coding a script where whenever the player steps onto a tile and presses a button, images blit and so on. Even though that script had nothing to do with the rest, all of my triggers and persons on the map stopped working after that.

My map only has one layer, and I even tried removing all traces of the image blitting code. No results. Making fresh triggers on the map with clear-cut scripts did not work as well. Is this a bug or something?

Re: Persons and Triggers not working
Reply #1
FIXED: in the strangest turn of events, I noticed that I had deleted AttachInput as I wanted WASD to be my movement keys, not the arrow keys. Replacing it made the triggers and persons work as intended. What the hell. makes. No. sense. at. all.

Re: Persons and Triggers not working
Reply #2
[Similar Issue:]
Weird, was having a similar problem trying to figure out.
Was attempting to initiate combat when
entities (persons) collided and made contact (touched).

Though the function doesn't trigger when the entities touch,
and instead only works suddenly when the player collides moving towards
the enemy entity that's moving towards him.

In other words, even though both player and the enemy are touching
the function doesn't always trigger, working only when they're both moving towards each other in collision.
Anybody care to take a guess at a solution? Don't mean to hijack by the way, just think the problems may be similar.

. . .

[Possible Solution for Yours:]
As for deleting AttachInput(), couldn't you just bind the arrowkeys to perform 'nothing' like so:
Code: (javascript) [Select]
 BindKey(KEY_UPRIGHTLEFTDOWN, '', ''); 


and keep AttachInput() in your script so that you keep the trigger registration working?
And then define the properties for the WASD keys in your movement script like so:
Code: (javascript) [Select]
 if (IsKeyPressed(WASD)) {Movement controls} 


If I'm not mistaken, deleting AttachInput() also means you would have to reattach and redefine
all the functions and things that make triggers work that are included in the AttachInput() function.
Radnen has done this with his Lithonite Library I believe for example, which is also massive in size.
So it's better to keep AttachInput() in the script, and redefine the keys.
  • Last Edit: July 30, 2013, 02:29:27 pm by Vakinox

Re: Persons and Triggers not working
Reply #3
There should be a config.exe file in the same folder as engine.exe. Using that you can change the movement keys to WASD.

BTW Vakinox, FBNil wrote Lithonite, not Radnen.