Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> lol I'm a mmf2 noob!
Togo
Razz
Posted: Sep 30 2009, 10:48 PM
Quote Post



[*][*][*]

Group Icon
Group: Members
Posts: 6007
Member No.: 4259
Joined: 13-August 07

Status: (0d) [--]


Hey, smart people of MFGG-- I'm making a rpg-overworld type thing in mmf2, and I need to check which kinda terrain the character is on; I have 40+ terrain types, all of them are active objects. Is there a fast way to find out what object shares the same coordinates as the player without having to check for overlapping instances and/or collisions? I've noticed that if you have a lot of collision events coupled with a lot of objects it slows the game down considerably.

I've tried checking if the player's coordinates match the terrain object's coordinates, but that doesn't work when there are lots of duplicate objects, apparently.

help?


--------------------
Allusion - [||--------] 25% complete
GridLocked - [||||------] 45% complete
my blog
PMEmail PosterAOL
Top
United States
Xgoff
Posted: Sep 30 2009, 11:41 PM
Quote Post


<):|
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03

Status: (0d) [--]


the best way to get this to work is to remember a couple of things:

1. use a many-to-one event; in other words, when dealing with object selection, there is a difference between X position of "lots_of_objects" = X("just_one_object") and X position of "just_one_object" = X("lots_of_objects"). you want to use the first one

2. don't use 'compare two general values' if you can avoid it; it jacks with object selection and you'll have to use fastloops

what you want to do is have an event like:

X position of "terrain_object" = X("player_object")
+ Y position of "terrain_object" = Y("player_object")
--> terrain_object: [do whatever]

you want to use Position -> compare x/y position for the terrain objects, and use X("Player_object") and Y("Player_object") in the expression box; needless to say i hope you have the hotspots for all the terrain objects in the upper left, because reliably getting offsets for this event can be a pain. you may also want to consider using x left("player_object") and y top("player_object") instead

it may help to have all of your terrain objects share a qualifier if they all need to do the same thing in this case


--------------------

This post may contain original research or unverified claims.
Please disregard the above information and contact an administrator.

DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth:
DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message
DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it
DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep
DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot
this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence
NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above

QUOTE
(5:25:58 PM) Mikau: xgoff
(5:26:00 PM) Mikau: guess what
(5:26:04 PM) Xgoff: chicken butt
(5:26:09 PM) Mikau: **** you
PMEmail PosterUsers WebsiteAOLMSN
Top
Togo
Razz
Posted: Oct 1 2009, 12:00 AM
Quote Post



[*][*][*]

Group Icon
Group: Members
Posts: 6007
Member No.: 4259
Joined: 13-August 07

Status: (0d) [--]


Whoa, never thought of doing that, thanks for the informative post, it helped a lot. And yeah, luckily I had the hot-spots set to the top-left, thank god. That would have been annoying to go through and edit every single image.


--------------------
Allusion - [||--------] 25% complete
GridLocked - [||||------] 45% complete
my blog
PMEmail PosterAOL
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0464 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.76 ]