Jump to content

Home

making bots use a force


NathanRahl

Recommended Posts

I need to make the bots use certain forces under certain conditions. What I tried was

 

level.clients[bs->client].ps.fd.forcePowerSelected=MY_FORCE;

useTheForce=1;

[\code]

 

in the StandardBotAI() function. Well, it doesn't seem to work, the bot does not use the force I want him to... Anyone have an idea?

Link to comment
Share on other sites

Basically it looks liek this:

 

...

if (MyCondition)

{

level.clients[bs->client].ps.fd.forcePowerSelected=MyForce;

useTheForce=1;

if (ChosenForceIsHostile)

{

forceHostile=1;

}

}

else

{

[standard if-else clauses]

}

 

if (useTheForce && forceHostile)

{

...

}

 

This all seem logical to me - the only thing I can imagine is that the condition for using a force are not good enough and the bot simply cannot use MyForce... Or what else could be it?

Link to comment
Share on other sites

Well, i don't know if this helps, but i modified the same bit of code and the bots did use different force powers.

Now, they certainly didn't use them with the sort of frequency i'd hoped, but they used them...

 

One problem could be if you're telling bots to use powers they don't have - that won't work in this function.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...