Full Version : Spawn on mounts
xmlspawner >>Q&A >>Spawn on mounts
<< Prev | Next >>
Oberon- 05-07-2006
Hello Arte,
give me advice how i make a spawn of NPC on mount please?
Thank you
ArteGordon- 05-07-2006
spawn them like this
subgroup 1: xmlquestnpc
subgroup 1: horse/rider/GETONSPAWN,1,serial
that will spawn the npc, and then spawn the mount and assign the rider of the mount the serial number of the npc.
It is important that you have them in that order so that GETONSPAWN,1 will get the xmlquestnpc (the first thing in subgroup 1) and assign that as the rider.
(edit)
while you can substitute any mob for the xmlquestnpc, only creatures with human body types will have the proper mounted animation by default.
Oberon- 05-07-2006
Thank you,
and could you explain me meaning a "serial" property?
Is it a serial number of spawner?
If it is, what is a correct format of this serial number?
I have a serial number in this format (I) 0x4058168A
ArteGordon- 05-07-2006

QUOTE (Oberon @ May 07, 2006 05:56 pm)
Thank you, and could you explain me meaning a "serial" property? Is it a serial number of spawner? If it is, what is a correct format of this serial number? I have a serial number in this format (I) 0x4058168A

all items and mobiles have a serial number that is a unique value assigned when they are created.
Any property that requires a mobile or item, can be assigned that mobile or item using their serial number.
I'm not sure why you would want to manually assign a property by serial number, but it can be done.
GETONSPAWN,1,serial
will get the serial number of the spawn in subgroup 1 (which in this case will be the xmlquestnpc).
It does not refer to the serial number of the spawner.
Then the rider property on the mount (that takes a mobile value) is assigned that serial number which is what assigns the xmlquestnpc to the rider of the mount.
Oberon- 05-07-2006
Thank you wery much, now is working perfect.
And i have once more question.
How i make a NPC on mount, which will running when hi will attack on a player.
I have try set Active and Passive speeds on NPC and on mount, but its doesnt work correct.
Mount with NPC going faster, but not running.
And i dont know why, but mount under NPC sometimes blink (despawn and respawn) for one second cca.
It isnt a big problem, but it doesn't look good.
Thank you for answer.
ArteGordon- 05-08-2006

QUOTE (Oberon @ May 08, 2006 01:22 am)
Thank you wery much, now is working perfect. And i have once more question. How i make a NPC on mount, which will running when hi will attack on a player. I have try set Active and Passive speeds on NPC and on mount, but its doesnt work correct.
Mount with NPC going faster, but not running.
And i dont know why, but mount under NPC sometimes blink (despawn and respawn) for one second cca.
It isnt a big problem, but it doesn't look good.
Thank you for answer.

What did you try setting the active and passive speeds to?
I would try something like the Neira settings of 0.175, 0.350
As for appearing off of their mounts, it is probably an AI thing having to do with certain animations.
I would guess that during wandering they do the fidget animation and that doesnt have a mounted version and so you see them get off.
Try setting their AI to something else. That may also change their speed behavior.
(edit)
I took a look at the default AI and it does not run. Only the mage AI runs. If you want mounted creatures with melee ai to run you need to make a mod like this.
In MeeleeAI.cs around line 85 in the DoActionCombat method, add these lines

QUOTE
if ( MoveTo( combatant, true, m_Mobile.RangeFight ) ) { m_Mobile.Direction = m_Mobile.GetDirectionTo( combatant ); // ARTEGORDONMOD // make mounted creatures run while fighting
if (m_Mobile.Mounted)
m_Mobile.Direction |= Direction.Running;
}

to get rid of the fidgeting animation while mounted go into BaseCreature.cs around line 2932 in the CheckIdle method

QUOTE
// ARTEGORDONMOD // no fidgeting while mounted if (Body.IsHuman && !Mounted) { switch (Utility.Random(2))
{
case 0: Animate(5, 5, 1, true, true, 1); break;
case 1: Animate(6, 5, 1, true, false, 1); break;
}
}

Oberon- 05-08-2006
OK thank you.
I have one last question.
How i spawn more then one NPC on mount in one subgroup?
Is it possible?
ArteGordon- 05-08-2006

QUOTE (Oberon @ May 08, 2006 07:58 am)
OK thank you. I have one last question. How i spawn more then one NPC on mount in one subgroup? Is it possible?

no, you would have to put them into different subgroups.
Vladimir- 06-08-2006
Hi there
I have an xmlquestnpc that i mount on a horse. Then i give him a waypoint to follow, but i want to increase the speed at which he travels along the path. I tried setting his active and passive speed to 0.175 and 0.325 respectively and changed his AI to AI_Mage... but i don't see any speed improvements. Any ideas?
ArteGordon- 06-08-2006
when you spawn them, just set the CurrentSpeed property directly to the value you want.
xmlquestnpc/currentspeed/0.175
Vladimir- 06-08-2006
ahh yea left out currentspeed :/ thx
Elassar- 03-21-2009
I tried to use this system, everything works fine but sometimes the horse and the xmlquestnpc spawn as 2 different mobs and not as a xmlquestnpc on mount...
Lichtblitz- 03-22-2009
Did you make sure they both are in the same subgroup? Did you make sure that the rider is the first entry of that subgroup? Please provide more information.
Elassar- 03-22-2009
Im sorry, my mistake... Works fine!
Vergo- 05-15-2009
Disregard this :>
Got it to work.
For those who are having trouble like I was, try this to learn how to do it initially:
In the first text field on the spawner, enter "xmlquestnpc" (without quotes)
In the second field, enter "horse/rider/GETONSPAWN,1,serial" (without quotes)
Now just set the subgroup of each entry to the same value (I used 1)
So it should look like this, with the spawner gump extended:
xmlquestnpc 1 1 1 1
horse/rider/GETONSPAWN,1,serial 1 1 1 1