Author Topic: Bot variables?  (Read 1444 times)

Basically stuff like <var:bot:maxhealth> and everything along with that.

This would be insanely useful

try <var:vehicle:maxhealth>


do the player replacers work on bots?

do the player replacers work on bots?

I don't think they do

registerSpecialVar(fxDTSbrick,"botHP","%this.hBot.getDatablock().maxDamage - %this.hBot.getDamageLevel()");
registerSpecialVar(fxDTSbrick,"botMAXHP","%this.hBot.getDatablock().maxDamage");
registerSpecialVar(fxDTSbrick,"botDB","%this.hBot.getDatablock().uiName");
registerSpecialVar(fxDTSbrick,"botName","%this.hBot.hName");
registerSpecialVar(fxDTSbrick,"botWeapon","%this.hBot.hWeapon");



these aren't tested, so they can give console errors if the bot doesn't exist
« Last Edit: July 06, 2015, 05:47:51 PM by Hawt »

registerSpecialVar(fxDTSbrick,"botHP","%this.hBot.dataBlock.maxDamage - %this.hBot.getDamageLevel()");
registerSpecialVar(fxDTSbrick,"botMAXHP","%this.hBot.dataBlock");
registerSpecialVar(fxDTSbrick,"botDB","%this.hBot.dataBlock");
registerSpecialVar(fxDTSbrick,"botName","%this.hBot.hName");
registerSpecialVar(fxDTSbrick,"botWeapon","%this.hBot.hWeapon");

these aren't tested, so they can give console errors if the bot doesn't exist

1. accessing datablocks directly throws a syntax error iirc, getDatablock() is preferable
2. you forgot the .maxDamage on the second line

1. accessing datablocks directly throws a syntax error iirc, getDatablock() is preferable
2. you forgot the .maxDamage on the second line
ok i fixed it

registerSpecialVar(fxDTSbrick,"botHP","%this.hBot.getDatablock().maxDamage - %this.hBot.getDamageLevel()");
registerSpecialVar(fxDTSbrick,"botMAXHP","%this.hBot.getDatablock().maxDamage");
registerSpecialVar(fxDTSbrick,"botDB","%this.hBot.getDatablock().uiName");
registerSpecialVar(fxDTSbrick,"botName","%this.hBot.hName");
registerSpecialVar(fxDTSbrick,"botWeapon","%this.hBot.hWeapon");



these aren't tested, so they can give console errors if the bot doesn't exist


It works flawlessly, thank youuuuuu

It works flawlessly, thank youuuuuu
no thank visolator cuz i posted it for him
« Last Edit: July 08, 2015, 11:05:32 PM by Hawt »

accessing datablocks directly throws a syntax error iirc, getDatablock() is preferable

This is only when doing %obj.datablock directly, as datablock is a reserved keyword. What he's doing there (%obj.dataBlock) works, but regardless, yes, ::getDataBlock() is better.