-
Active areas?
Hey guys!
Been trying to find out what you can do with the software, so far I'm quite impressed.
Been trying to figure how to create a inventory system, something small, little bit like in Silent Hill 2.
Well that might be for advanced users and only later on.
Anyway, is it possible to do an object, in this case let's think of a door. And when you are standing in front of the door, you can open it by clicking selected button.
So I'm trying to figure how to do active area like these, to pick up items, trigger flags within these areas etc.
Any tutorial for such? :)
Thanks!
- Jesse
-
You can position an active object in relation to the player object, for example, usually just a box is used that always moves to in front of the player depending on the direction the player faces. Then you check for overlap with that box and another object, like a door, along with the button click condition. You can make this box object invisible at start.
That, or you could try and compare the position of the door with the position of the player. Though this method requires a lot of position calculating and can lead to inaccuracy since if you have 5 doors on screen, you have to tell MMF to actually look at each individual door and compare it's position to the player. While the above solution automatically selects the right door since the box object is overlapping it.
-
Ah okey thats good idea! I'll try that. Thanks!
Little off topic, is there a way to add object to a screen, so it's position is always absolute.
I have screen scrolling, so I would like to keep particular object in right corner all the time.
Tried to make it's position relative to my character, but then it will move untill my character is in the middle of a screen.
Surely there is easy way to accomplish this? :)
Thanks again!
EDIT: I can check overlapping with objects, but how can I check button click condition at the same time?
EDIT2: Ah you can apply two commands in the same field.. nice! :D
Works like a dream, thanks! =)
Still figuring how to position things so they stay there even if I scroll.
-
To make objects stay where they are uncheck 'follow the frame' in the object's properties, either that or you can set their position(s) manually in the event editor (Set X/Y)
-
Can't believe it was that easy. I knew it was, but still I tried to position it with cordinates and stuff. :D
Thanks Danny and Konidias! :)
-
One more thing, sorry guys. :D
Is there a way to disable and enable item? Cause when you hide item, it's still there.
I'm looking to enable object when I turn on specific flag.
-
I don't follow, however I assume you mean it's still triggering the collision event while hidden and you don't want it to? If so, just add another condition to the event where you want it to do stuff when enabled:
+Flag 0 is On
-
Ah I kind of conused myself also. Okey I got it now! :)
Thanks!
-
Ah okey I thought I got it. So yeah I have hidden object which will trigger something I dont want to, not yet.
I'm trying to do such thing: Upon pressing arrow up - I want to activate my hidden object.
So I tried like this: "Upon pressing arrow up - turn internal flag 1 on" <- basically it would work, but I don't know how to make the switch disable and enable object. If I only hide it, it still triggers.
And I turn the flag off by hitting arrows other way. So it would only activate when I press arrow up.
So as Danny suggested, adding another condition to the event. But I can't find anything to disable and enable object.
EDIT: Don't know what makes me figure a way around just when I post here. Don't know if it's a bad way, but I made a layer for my invisible boxes, and when flag is on, it moves the box to active layer. And when flag is off, it moves the box to my "boxlayer" and then it's not triggering anymore. So basically it works now. :)
But still if there is a better way I would not mind hearing it!
Any advise? :)
Oh and I also noticed, that choosing 8-direction movement, it wont lag at all, unless you hit the border. Was thinking if there is a way to set some kind of cordinates, that won't allow me to go closer than few pixel to my active object etc? :)
-
J3sseM, you need to exclude hidden objects in the event.
Simply add an Object is visible condition in the event.
Example:
* Player is overlapping Box
+ Box is visible
- Player: Bounce