EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Bots (https://www.eqemulator.org/forums/forumdisplay.php?f=676)
-   -   Anyone able to help (https://www.eqemulator.org/forums/showthread.php?t=33798)

Criimson 07-05-2011 12:19 PM

Anyone able to help
 
So I have been having a bitch of a time with a conversion.
Tried everything I could think of and no luck.
Anyone able to help with this?

Code:

//Criimson added Bot follow distance - SetFollowDistance
        if(!strcasecmp(sep->arg[1], "setfollowdistance")) {
                if((c->GetTarget() == NULL) || (c->GetTarget() == c) || (!c->GetTarget()->IsBot()) ) {
                        c->Message(15, "You must target a bot!");
                }
                else {
                        //string strConvert = (sep->arg[2]);
                        //c->Message(15, strConvert);
                        //int32 BotFollowDistance = atoi(strConvert.c_str());
                        //int32 BotFollowDistance = atoi(strConvert);
                        //int32 BotFollowDistance = atoi(sep->arg[2]);
                        //int32 BotFollowDistance = Convert::ToInt32((sep->arg[2]), 16);
                        //SetFollowDistance(BotFollowDistance);
                }

                return;
        }


LEft all the things Ive tried in comments so I could look it over as I scratched me head.
Thank you
Criimson

Derision 07-05-2011 01:00 PM

Seems like
Code:

int32 BotFollowDistance = atoi(sep->arg[2]);
which you have already tried, should work, however you will also want to use
Code:

c->GetTarget()->SetFollowDistance(BotFollowDistance);
rather than just
Code:

SetFollowDistance(BotFollowDistance);

Criimson 07-05-2011 01:46 PM

I love you.

Works like a charm. Now I can set all of my bots at different distances. Melees close and casters far, with none of them standing on the other.

Thank you

Criimson

revloc02c 07-06-2011 10:06 AM

Quote:

Originally Posted by Criimson (Post 201242)
I love you.

ROFL

I know exactly how you feel--pullin your hair out for hours and then some kind soul finally shows you the way.


All times are GMT -4. The time now is 04:16 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.