Avatars on bots

Please use this forum to ask all your MoHAA Bots questions / discussions

Moderator: Moderators

Post Reply
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Avatars on bots

Post 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 :D
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :)
Image
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

by just replacing local.bot (all the variations) with local.player (or whatever)?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yup.

You need to include the models/hud/allies.tik and models/hud/axis.tik files though.
Image
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

ok thanks man :D
Yarik
General
Posts: 1031
Joined: Thu Jan 09, 2003 7:12 pm
Contact:

Post 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.
Skype: Yarik_usa
www.skype.com <---free pc2pc phone
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I know. But I don't know how to make something visible for one team only :(
Image
Post Reply