Here is another snippet I have written that incorporates the scatter around a point code. The idea being that the toons will look as though they are being controlled by humans at first glance; as they will follow you loosely, matching your heading and not drifting off too far, and then coming to rest at a point near you.
I havent fully decided if this is a good thing or not... because if people determine that your characters are being played by one person - well then its fairly obvious that your macro'ing because there is no way that a person with only 2 hands could control 6+ characters to such a degree. However, when people see 5 toons all standing on top of each other following another toon, they probably think MQ'er anyway.
If you're standing beside a zone line, dont start the script off because your toons could go through the zone line... if the script is running though it seems to follow through zones though with no problems. Running backwards just messes with your toons because they will try to face the same direction as you so try to avoid it, and strafing doesnt really help either. Not tested indoors.
To activate type >>> /bc follow [charname]. <<<
Or use groupsay, irc, whatever. Don't forget the fullstop.
Code: Select all
#event follow "#*#follow #1#.#*#"
#event face "Arrived at MoveTo location"
sub main
/declare folperson string outer
/declare faceang int outer
/declare MAXrange int outer 30
/declare randrange int outer
/declare randangle int outer
/declare gotoX int outer
/declare gotoY int outer
/declare lastX int outer
/declare lastY int outer
/declare melastX int outer
/declare melastY int outer
/declare loctimer timer outer
/declare gotspot bool outer false
/declare movefinished bool outer false
/declare havefaced bool outer TRUE
:mainloop
/doevents
/goto :mainloop
/return
Sub Event_follow(Line,person)
/varset folperson ${person} PC
/call SetSpot
/moveto off
/moveto loc ${gotoY} ${gotoX}
:waitformove1
/doevents
/if (${movefinished}) {
/goto :followloop
/varset movefinished FALSE
}
/goto :waitformove1
:followloop
/doevents
/if (${Spawn[${folperson}].Distance}>40 && ${Spawn[${folperson}].Distance}<80 && !${gotspot}) {
/keypress forward hold
/if (${Spawn[${folperson}].Heading.Degrees}>${Math.Calc[${Me.Heading.Degrees}+10]} || ${Spawn[${folperson}].Heading.Degrees}<${Math.Calc[${Me.Heading.Degrees}-10]} && ${Spawn[${folperson}].Distance}<100) {
/face Heading ${Math.Calc[${Spawn[${folperson}].Heading.DegreesCCW}+${Math.Rand[15]}]}
}
}
/if (${Spawn[${folperson}].Distance}>80 && !${gotspot}) {
/face Heading ${Spawn[${folperson}].HeadingTo.DegreesCCW}
/if (${gotspot}) /varset gotspot false
/keypress forward hold
}
/if (${Spawn[${folperson}].Distance}<20 && !${gotspot}) /keypress forward
/if (${loctimer}<1) {
/varset lastX ${Spawn[${folperson}].X.Int}
/varset lastY ${Spawn[${folperson}].Y.Int}
/varset melastX ${Me.X.Int}
/varset melastY ${Me.Y.Int}
/varset loctimer 15
/delay 8
}
/if (${Spawn[${folperson}].X.Int}==${lastX} && ${Spawn[${folperson}].Y.Int}==${lastY} && !${gotspot}) /call SetSpot
/if (${Spawn[${folperson}].X.Int}!=${lastX} && ${Spawn[${folperson}].Y.Int}!=${lastY} && ${gotspot}) /varset gotspot FALSE
/if (${Math.Distance[${gotoY},${gotoX}]}>15 && ${gotspot}) {
/keypress forward hold
/face Heading ${Me.HeadingToLoc[${gotoY},${gotoX}].DegreesCCW}
}
/if (${Math.Distance[${gotoY},${gotoX}]}<35 && ${gotspot}) {
/keypress forward
/if (${Me.X.Int}==${melastX} && ${Me.Y.Int}==${melastY} && !${havefaced} ) {
/face Heading ${faceang}
/delay ${Math.Rand[20]}
}
}
/goto :followloop
/return
Sub SetSpot
/varset faceang ${Math.Calc[${Spawn[${folperson}].Heading.DegreesCCW}+${Math.Rand[30]}]}
/varset randrange ${Math.Rand[${MAXrange}]}
/varset randangle ${Math.Rand[360]}
/varset gotoX ${Math.Calc[${Spawn[${folperson}].X}+${Math.Calc[${randrange}*${Math.Cos[${randangle}]}]}]}
/varset gotoY ${Math.Calc[${Spawn[${folperson}].Y}+${Math.Calc[${randrange}*${Math.Sin[${randangle}]}]}]}
/varset gotspot TRUE
/varset havefaced FALSE
/return
Sub event_face
/face Heading ${Math.Calc[${faceang}-${Math.Rand[30]}]}
/delay 1s
/varset movefinished TRUE
/return