Full Version : Spawn vs. Despawn
xmlspawner >>Q&A >>Spawn vs. Despawn


<< Prev | Next >>

malavon- 03-24-2006
Hi! I can make spawn of doors, which will be despawned, when player come to spawner (proximity < 5). When proximity is greater than 5, door will be spawned.

Steps

1. standard spawn doors
2. if proximity <= 5 then doors will be despawned
3. if proximity >= 5 then doors will be spawned

and modification

3. wait until 10 sec then doors will be spawned

It's real to make this with XMLSpawner? Sorry for maybe stupid question, but I'm new with XMLSpawner and all of my attempts was wrong.

ArteGordon- 03-24-2006
There are a number of ways that you could do this, but one way would be to use the PLAYERSINRANGE keyword to test to see how many players are nearby and then spawn or despawn accordinglyt

QUOTE

- added the PLAYERSINRANGE,range value keyword that gives you access to the number of players within the specified range (thanks to CEO for the idea).  This could be used to control what got spawned based on nearby player number, rather than just trig/notrig. So you could do things like

IF/PLAYERSINRANGE,5>2/33


so you would have spawn entries like


subgroup 1: IF/PLAYERSINRANGE,5=0/33/44
subgroup 2 GOTO/1
subgroup 33: metaldoor,0
subgroup 44: SETONSPAWN,33/DELETE


and then just make sure that you have sequential spawning set, and set your min/maxdelay to like 5 seconds.
So it will run through the sequence like this

first it will do subgroup 1. If there are no players within 5 tiles it will execute subgroup 33 (spawn a door) otherwise it will execute subgroup 44 (delete the door).

Then it will advance to subgroup 2, which will send it back to subgroup 1, etc.

There will be a delay in both deleting and respawning the door.

If you wanted fast deletion of the door, but slower respawn of the door, you could have two spawners. One like this to spawn the door


Name="DoorSpawner#1"
subgroup 1: IF/PLAYERSINRANGE,5=0/33
subgroup 2 GOTO/1
subgroup 33: metaldoor,0


and then another to delete the door, set to proximity trigger with a range of 5, SpawnOnTrigger set to true, and with the entry


SETONSPAWN,DoorSpawner#1,33/DELETE


Here is an example of that

QUOTE

<Spawns>
  <Points>
    <Name>DoorDeleter#1</Name>
    <UniqueId>1866ada5-f3eb-44dd-a7bd-c502b12eb0b3</UniqueId>
    <Map>Felucca</Map>
    <X>5502</X>
    <Y>1106</Y>
    <Width>10</Width>
    <Height>10</Height>
    <CentreX>5507</CentreX>
    <CentreY>1111</CentreY>
    <CentreZ>0</CentreZ>
    <Range>5</Range>
    <MaxCount>1</MaxCount>
    <MinDelay>5</MinDelay>
    <MaxDelay>10</MaxDelay>
    <DelayInSec>False</DelayInSec>
    <Duration>0</Duration>
    <DespawnTime>0</DespawnTime>
    <ProximityRange>5</ProximityRange>
    <ProximityTriggerSound>500</ProximityTriggerSound>
    <TriggerProbability>1</TriggerProbability>
    <InContainer>False</InContainer>
    <MinRefractory>0</MinRefractory>
    <MaxRefractory>0</MaxRefractory>
    <TODStart>0</TODStart>
    <TODEnd>0</TODEnd>
    <TODMode>0</TODMode>
    <KillReset>1</KillReset>
    <ExternalTriggering>False</ExternalTriggering>
    <SequentialSpawning>-1</SequentialSpawning>
    <AllowGhostTriggering>False</AllowGhostTriggering>
    <SpawnOnTrigger>True</SpawnOnTrigger>
    <SmartSpawning>False</SmartSpawning>
    <Team>0</Team>
    <Amount>1</Amount>
    <IsGroup>False</IsGroup>
    <IsRunning>True</IsRunning>
    <IsHomeRangeRelative>True</IsHomeRangeRelative>
    <Objects2>SETONSPAWN,Doorspawner#1,33/DELETE:MX=1:SB=0:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1</Objects2>
  </Points>
  <Points>
    <Name>DoorSpawner#1</Name>
    <UniqueId>3f36b716-b284-4688-b063-9ce94bc50d92</UniqueId>
    <Map>Felucca</Map>
    <X>5508</X>
    <Y>1111</Y>
    <Width>0</Width>
    <Height>0</Height>
    <CentreX>5508</CentreX>
    <CentreY>1111</CentreY>
    <CentreZ>0</CentreZ>
    <Range>5</Range>
    <MaxCount>3</MaxCount>
    <MinDelay>5</MinDelay>
    <MaxDelay>5</MaxDelay>
    <DelayInSec>True</DelayInSec>
    <Duration>0</Duration>
    <DespawnTime>0</DespawnTime>
    <ProximityRange>-1</ProximityRange>
    <ProximityTriggerSound>500</ProximityTriggerSound>
    <TriggerProbability>1</TriggerProbability>
    <InContainer>False</InContainer>
    <MinRefractory>0</MinRefractory>
    <MaxRefractory>0</MaxRefractory>
    <TODStart>0</TODStart>
    <TODEnd>0</TODEnd>
    <TODMode>0</TODMode>
    <KillReset>1</KillReset>
    <ExternalTriggering>False</ExternalTriggering>
    <SequentialSpawning>1</SequentialSpawning>
    <AllowGhostTriggering>False</AllowGhostTriggering>
    <SpawnOnTrigger>False</SpawnOnTrigger>
    <SmartSpawning>False</SmartSpawning>
    <Team>0</Team>
    <Amount>1</Amount>
    <IsGroup>False</IsGroup>
    <IsRunning>True</IsRunning>
    <IsHomeRangeRelative>True</IsHomeRangeRelative>
    <Objects2>IF/PLAYERSINRANGE,5=0/33:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1:OBJ=GOTO/1:MX=1:SB=2:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1:OBJ=metaldoor,0:MX=1:SB=33:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1</Objects2>
  </Points>
</Spawns>