Full Version : Dismount
xmlspawner >>XMLSpawner Mods and Tips >>Dismount


<< Prev | Next >>

ArteGordon- 09-01-2006
need to see the spawner placement and the spawner entries and props to determine what the difference is.
If you post the XML for them that would be best.

Gembone- 09-01-2006
ok I am not sure how to get the xml for them. if you could explain I will gladly get it for you. and here is a pic of the spawners with the ranges visible and the props open to show all changes made

http://home.comcast.net/~gembone/Spawners.jpg

ArteGordon- 09-01-2006
I cant see all of the props on the second case and I will assume none of the props that cant be seen have been changed from their defaults, but you should turn off smartspawning.

To save out the spawners to XML use [xmlsave

[xmlsave dismounter.xml Dismount

which will save all of the spawners that begin with the string "Dismount" to the file "dismounter.xml"

Gembone- 09-01-2006
ok here is the spawner xml from the one that works without spamming
CODE
<Name>Dismounter</Name>
 <UniqueId>48986fa5-2182-4780-966a-419a3ef44404</UniqueId>
 <Map>Ilshenar</Map>
 <X>1178</X>
 <Y>1126</Y>
 <Width>12</Width>
 <Height>12</Height>
 <CentreX>1184</CentreX>
 <CentreY>1132</CentreY>
 <CentreZ>-25</CentreZ>
 <Range>5</Range>
 <MaxCount>1</MaxCount>
 <MinDelay>5</MinDelay>
 <MaxDelay>10</MaxDelay>
 <DelayInSec>False</DelayInSec>
 <Duration>0</Duration>
 <DespawnTime>0</DespawnTime>
 <ProximityRange>6</ProximityRange>
 <ProximityTriggerSound>500</ProximityTriggerSound>
 <ProximityTriggerMessage>No Mounts Allowed!</ProximityTriggerMessage>
 <PlayerPropertyName>mounted=true</PlayerPropertyName>
 <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>
 <AllowNPCTriggering>False</AllowNPCTriggering>
 <SpawnOnTrigger>True</SpawnOnTrigger>
 <SmartSpawning>True</SmartSpawning>
 <Team>0</Team>
 <Amount>1</Amount>
 <IsGroup>False</IsGroup>
 <IsRunning>True</IsRunning>
 <IsHomeRangeRelative>True</IsHomeRangeRelative>
 <Objects2>SETONTRIGMOB/DismountAndStableFollowers/true:MX=1:SB=0:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1</Objects2>



and here is the one that is Spamming

CODE
<Name>Dismounter</Name>
 <UniqueId>db08f943-b6fe-4158-bf78-d710e88fbd9e</UniqueId>
 <Map>Ilshenar</Map>
 <X>751</X>
 <Y>1131</Y>
 <Width>16</Width>
 <Height>16</Height>
 <CentreX>759</CentreX>
 <CentreY>1139</CentreY>
 <CentreZ>-30</CentreZ>
 <Range>5</Range>
 <MaxCount>1</MaxCount>
 <MinDelay>5</MinDelay>
 <MaxDelay>10</MaxDelay>
 <DelayInSec>False</DelayInSec>
 <Duration>0</Duration>
 <DespawnTime>0</DespawnTime>
 <ProximityRange>8</ProximityRange>
 <ProximityTriggerSound>500</ProximityTriggerSound>
 <ProximityTriggerMessage>No Mounts Allowed!</ProximityTriggerMessage>
 <PlayerPropertyName>mounted=true | Followers > 0</PlayerPropertyName>
 <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>
 <AllowNPCTriggering>False</AllowNPCTriggering>
 <SpawnOnTrigger>True</SpawnOnTrigger>
 <SmartSpawning>False</SmartSpawning>
 <Team>0</Team>
 <Amount>1</Amount>
 <IsGroup>False</IsGroup>
 <IsRunning>True</IsRunning>
 <IsHomeRangeRelative>True</IsHomeRangeRelative>
 <Objects2>SETONTRIGMOB/DismountAndStableFollowers/true:MX=1:SB=0:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1</Objects2>


these are also the 2 I showed you in the pics I believe from the x,y

Gembone- 09-01-2006
ok I think I see why one does and the other does not

from first one
CODE
<PlayerPropertyName>mounted=true</PlayerPropertyName>


from the second
CODE
<PlayerPropertyName>mounted=true | Followers > 0</PlayerPropertyName>


the first one is letting the into building with followers as long as they are not mounted whne entering. while the second checks for followers wether mounted or not.

ArteGordon- 09-01-2006
right. that would be it.

Gembone- 09-01-2006
ok so I guess my question now is can it be made to first see if mounted. second see if they have followers within 2 tiles of player and to stable it true, and third to see if not mounted and followers are not withing 2 tiles for it to stop spamming the players.


EDIT: maybe take the followers part out of the setontrigger and add a second setontrigger for just the followers within 2 tiles? or would this still spam the player as well? This way they can stay there followers outside the building and go in without getting spammed while trying to RP.

ArteGordon- 09-01-2006
You could change the DismountAndStableFollowers property slightly to allow you to detect nearby followers and mounts, and the test for that property instead of doing the "mounted=true | followers > 0"

Like this

QUOTE

        public bool DismountAndStableFollowers
        {
            get
            {
                // true if mounted
                if (Mount != null) return true;

                // or if there are followers within the specified range
                foreach (Mobile m in this.GetMobilesInRange(10))
                {
                    BaseCreature bc = m as BaseCreature;
                    if (bc != null && bc.ControlMaster == this && bc.Controlled)
                        return true;
                }
                return false;
            }

            set
            {
                if (value == true)
                {
                    if (Mount != null)
                    {
                        // dismount
                        Mount.Rider = null;
                    }

                    ArrayList stablelist = new ArrayList();
                    // check for followers within the specified range
                    foreach (Mobile m in this.GetMobilesInRange(10))
                    {
                        BaseCreature bc = m as BaseCreature;
                        if (bc != null && bc.ControlMaster == this && bc.Controlled)
                            stablelist.Add(bc);
                    }

                    foreach (BaseCreature bc in stablelist)
                    {
                        if (Stabled.Count >= AnimalTrainer.GetMaxStabled(this))
                            break;

                        // stable it
                        bc.ControlTarget = null;
                        bc.ControlOrder = OrderType.Stay;
                        bc.Internalize();
                        bc.SetControlMaster(null);
                        bc.SummonMaster = null;
                        Stabled.Add(bc);

                    }

                    if (stablelist.Count > 0)
                        Say("Your followers have been stabled.");
                }
            }
        }


Then for your test, just use "DismountAndStableFollowers=true"

Gembone- 09-01-2006
what if anything needs to be changed on the spawners. they are still spamming.

I do appologise for taking up so much of your time with this, but I really appreciate all your help.

ArteGordon- 09-01-2006
If you made the modification the DismountAndStableFollowers property that I described above, then you just need to change the PlayerTrigProp to "DismountAndStableFollowers=true"

Gembone- 09-01-2006
well when I change the playertrigproperty in props to "DismountAndStableFollowers=true" then the spawner doesn't work at all.

ArteGordon- 09-01-2006
QUOTE (Gembone @ September 01, 2006 12:21 pm)
well when I change the playertrigproperty in props to "DismountAndStableFollowers=true" then the spawner doesn't work at all.

did you add the modifications to DismountAndStableFollowers in playermobile.cs that I posted above?

Gembone- 09-01-2006
ok thought I had but I hadn't but now pm error with this line.
CODE
   if (bc != null && bc.ControlMaster == this && bc.Controlled)


BaseCreature does not contain definition for controlled.
hmmm wait a min wan't that one of the misspellings in 1.0....ok yeah that fixed it.

now back to testing

OK wonderful everything is working great now. Thanks so much for your patience, time, knowledge, and willingness to help anyone who asks.