More on Zones and Entities in V2.0
Displaying 1-8 of 8 total.
1
Zeke
|
I'm trying to have a zone that activates an event when a non-player entity moves onto it. I should point out that I want to activate the zone's event, not the entity's event.
From the documentation I have, this looks like it should be simple: just type the event number in the "entity" field of the zone's info box in MapEd2. If I understand correctly, you don't even need to worry about the chance and delay fields. But for some reason, it doesn't work.
I've tried changing the chance, but wether I put it at 0 or 255, the event never gets called. I've also tried making a different zone than the one that calls my player script, but that doesn't work either.
Is there something I'm forgetting or overlooking?
Thanks again.
Posted on 2001-06-15 20:35:27
|
grenideer
|
I don't know what to say except that I've never used that feature before, or even realized what is was supposed to do.
On a side note, since I checked the documentation and it's been years since I last did, I notice the maximum to the chance field IS supposed to be 256. Does anyone know why I have always been using 255? The difference would be incredibly hard to perceive, but it could 'break' a game. Is 255 really NOT the max?
Posted on 2001-06-16 01:14:13
|
grenideer
|
The docs were wrong. 255 IS the max. Anything over won't hurt though.
Posted on 2001-06-16 01:24:47
|
andy
|
That particular zone attribute never got implemented. -_-
You'll have to do some funky coding with a hooked script to achieve that effect.
int i,z;
for (i=0; i
'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald
Posted on 2001-06-16 01:31:13
|
andy
|
I'm tired. -_-;
'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald
Posted on 2001-06-16 01:36:26
|
zero
|
ok well first off the chances arnt whats wrong... only the player can activate the zones with chances... and as for the entity moving onto it what your going to probly have to do is use callevent(); which is a undocumented function but it seems to work pretty well =).
syntax:
callevent(int event);
so if you wanted to call evnt 10 youd just do:
callevent(10);
hope it helps =)
-X3r0-
Posted on 2001-06-16 10:50:23
|
Zeke
|
But thank you for the advice on undocumented functions and places where the docs are simply incorrect.
Um, just out of curiosity, would V2.7 be able to do stuff like this (scripts for the default zone, entity-activated scripts, etc.)? It would be really helpful in avoiding some complicated workarounds.
Now I'm trying to visualize the workaround for this. CallEvent will only work if I'm already in some kind of function/script already. I need something that the engine itself will call. I can't use HookKey for this kind of thing, and it would probably be a bad idea to put it in HookTimer, so I guess that just leaves HookRetrace? For every frame drawn I check to see if any entity is standing on any tile I want to activate something. If yes, I call the appropriate script. Seems this is going to cause frame rate problems, though, since the rendering doesn't finish until I get out of the function/script called by HookRetrace.
Can anyone think of a better way?
Thanks, yet once more.
Posted on 2001-06-16 11:46:09
|
andy
|
There's a built in array of entity indeces who are on the screen at the moment.
If you want to cut back on the processing, you could only do the check for the ones that are onscreen. (might not be what you want, though)
Look up entsonscreen and numentsonscreen
'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald
Posted on 2001-06-17 20:00:25
|