FR_Patriot
|
I have a few questions about using entities in V27.
- How can I use an internal entity function (entity.whatever) on an existing, MapEd created entity?
- Can and/or how I move an entity by directly changing its x and y values? If so, then if I move a map-obstructable entity by changing its values onto an obstruction, what will happen?
- What kind of collisions does entity.DetectCollision() detect?
If you help me, thank you for your help.
If you read my posts, thanks for taking the time to do so.
If you did not even read the post than how the heck did you see this?
Posted on 2001-08-15 22:50:23
|
andy
|
- Yes. The engine creates a dictionary of entities that live on the map when it loads it, called 'map.entities'. To make some entity or other do something, you can do so:
map.entities['Bob'].Move('U32') # walk 32 pixels upwards
Note that the name, (Bob in this case) is set in the 'name' field of the entity editor within winmaped. Be sure to give each entity a unique name! Eventually, the engine will detect redundant names and auto-change them on its own, but until then, it's up to you. :)
- Yes. Just set their values like any other varaible. This is *unconditional*. The entity is moved precisely where you move it, regardless of map/entity placement.
- Entity/entity collisions. I've found that iterating through a loop in Python to detect such a collision is agonizingly slow. So I provided an interface to a loop implemented in C, which is much, much faster. ^_~
"Ignorance is its own reward" -- Proverb
Posted on 2001-08-16 16:45:56
|