Game Development Community

How does the Armor class work in player.cs?

by Rob Riddell · in Technical Issues · 05/31/2004 (3:00 am) · 1 replies

In the creation of the datablock PlayerData(PlayerBody)

there is a line that says:

className = Armor;

Then at the end is all definitions of :
// Armor Datablock methods
function Armor::onAdd(%this,%obj)
function Armor::onRemove(%this, %obj)

etc.

What is armor referring to? I don't understand. Is this referring to only all vehciles as armor?

If I am trying to create a mountable thinking animal then I want to use aiplayer.cs renamed to animal.cs?

Or do I rename and modify player.cs as animal.cs, (with PlayerData(AnimalBody) defining the animal body model and behaviors) then resave aiplayer as AIaniml.cs with:
datablock PlayerData(DemoPlayer : PlayerBody) changed to
datablock PlayerData(DemoAnimal : AnimalBody)

Then I will have created the basics needed to start adding AI to the animal when it is not being ridden. And certainly the animal model will have a mountable node. wpn0

%aiplayer.mountObject(%player, 0); needs to be inserted somewhere in the AIAnimal.cs also. I have modified the player.cc file with the following suggestion by Haddoken:

The player and aiplayer will collide all the time tho, causing strange behaviours, but you can prevent this by looking for the Player::buildConvex() function in player.cc and adding:

if (isMounted()) return;

I am working on this puzzle. I have done some of the vehicle adding tutorials, but what I want is not just a vehicle, but an animal that walks and reacts like an aiplayer, but is mountable.

Thanks in advance. Smiles.

#1
05/31/2004 (7:15 am)
Maybe I can combine the AIanimal.cs and animal.cs files?