Does each monster or NPC have a unique ID? When changing into a monster, could the transforming NPC keep its ID?
If so, providing the ability for an NPC to query its own ID might better enable the NPC ->
monster ->
NPC scenario. I suppose the ability for an NPC to duplicate itself might also be required there too.
Imagine the following longwinded scenario:
1. The variable StoredID is set to 1.
2. An NPC (with ID=1) sits in a loop. If its current ID is equal to StoredID, it enters an inner loop.
3. In the inner loop, the NPC checks whehter the conditions to turn into a monster have been met. If so, the NPC stores its ID to StoredID.
3.1. The NPC calls DuplicateSelf(x,y) to produce a double on another coordinate. This duplicate has a new ID.
3.2. The NPC immediately transforms into a monster, maintaining its same ID.
4. The duplicate NPC sits in a loop checking for the condition that will prompt ReplaceEntity.
4.1. If that condition is met, the duplicate calls ReplaceEntity. ReplaceEntity takes a MyScript variable representing StoredID to indicate which monster should be replaced with the duplicate NPC.
5. The duplicate NPC (with its new ID) goes back to step 2.
____________________________
http://beepsandbloops.wordpress.com/
[Last edited by RoboBob3000 at 04-02-2010 05:19 PM]