Page 1 of 1
Avatars on bots
Posted: Thu Apr 17, 2003 11:47 pm
by TheShiznaeSpe
I've looked through scripts, and I've only found one thing about avatars-it was in the jv_map_ai script
Code: Select all
initvars:
local.showavatar = getcvar(jvbot_showavatar)
if(local.showavatar == "0")
level.jvbot_showavatar = 0
else
{
level.jvbot_showavatar = 1
setcvar "jvbot_showavatar" "1"
}
local.botskill = int(getcvar(jvbot_skill))
if !(local.botskill >= 1 && local.botskill <= 4) // 1, 2, 3 or 4
local.botskill = 2 // default
setcvar "jvbot_skill" local.botskill
level.jvbot_skill = local.botskill
end
i can;t figure out for the life of me what this means-if u can tell me how ur avatars were done (and if they are applicable to human players)
thanks

Posted: Fri Apr 18, 2003 6:11 am
by jv_map
The real avatar code is in spawnhandler_default.scr and lib_console.scr (long live the mess

).
spawnhandler_default.scr:
Code: Select all
if(level.jvbot_showavatar == 1)
{
local.newbot.headicon = spawn ("models/hud/" + local.team + ".tik")
local.newbot.headicon attach local.newbot "Bip01 Neck"
}
lib_console.scr:
Code: Select all
/**
Shows all bot head icons.
*/
showavatars:
if(level.botlastid != NIL)
{
for(local.i = 1; local.i <= level.botlastid; local.i++)
{
local.bot = level.actualbots[local.i]
if(isAlive local.bot)
{
local.avatar = spawn ("models/hud/" + local.bot.dmteam + ".tik")
local.avatar attach local.bot "Bip01 Neck"
local.bot.headicon = local.avatar
}
}
}
else
println "ERROR[lib_console::showavatars]: Bot script not running."
end
/**
Hides all bot head icons.
*/
hideavatars:
if(level.botlastid != NIL)
{
for(local.i = 1; local.i <= level.botlastid; local.i++)
{
local.bot = level.actualbots[local.i]
if(local.bot.headicon)
local.bot.headicon remove
}
}
else
println "ERROR[lib_console::showavatars]: Bot script not running."
end
You can do this for human players as well

Posted: Fri Apr 18, 2003 11:35 am
by TheShiznaeSpe
by just replacing local.bot (all the variations) with local.player (or whatever)?
Posted: Fri Apr 18, 2003 2:03 pm
by jv_map
Yup.
You need to include the models/hud/allies.tik and models/hud/axis.tik files though.
Posted: Fri Apr 18, 2003 10:22 pm
by TheShiznaeSpe
ok thanks man

Posted: Sat Apr 19, 2003 2:21 am
by Yarik
JV i got a Q for you. How come we can see the Little Icons of the Opposing team bots? I mean its too easy to play like that.
Posted: Sat Apr 19, 2003 6:10 am
by jv_map
I know. But I don't know how to make something visible for one team only
