It looks like an awful lot of stuff is happening in Lua scripts rather then in the C++ code. This includes spawning of objects and loading meshes for instance. I guess it's a good thing since scripters can change many of the game parameters without changing the code.
File Structure
Modifying Entity Parameters
Player = {
AnimationGraph = "HumanMaleFullBody.xml",
UpperBodyGraph = "HumanMaleUpperBody.xml",
type = "Player",
foreignCollisionDamageMult = 0.1, vehicleCollisionDamageMult = 7.5,
Properties =
{ -- AI-related properties
soclasses_SmartObjectClass = "Player",
groupid = 0,
esFaction = "Players",
commrange = 40; -- Luciano - added to use SIGNALFILTER_GROUPONLY
-- AI-related properties over
voiceType = "player",
aicharacter_character = "Player",
Perception =
{
--how visible am I
camoScale = 1,
--movement related parameters
velBase = 1,
velScale = .03,
--ranges sightrange = 50,
} ,
--
fileModel = "Objects/characters/SDK_player/SDK_Player.cdf",
clientFileModel = "Objects/characters/SDK_player/SDK_Player.cdf",
fpItemHandsModel = "Objects/Weapons/Agent_fp/Agent_fp_Global.chr",
objFrozenModel= "Objects/characters/SDK_player/SDK_Player.cdf",
So you can replace the player model simply by editing parts of this script.
For the minions I think we can use Grunt entity with some modifications which is going to be much easier then creating a new one from scratch. The relevant file is under Game/Scripts/entities/ai/grunt_x.lua.
If you wish to create new entity (for example something to put on the map) simply create a new .ent (i.e. Game/Entities/MyEntity.ent) file which contains only this line:
For the minions I think we can use Grunt entity with some modifications which is going to be much easier then creating a new one from scratch. The relevant file is under Game/Scripts/entities/ai/grunt_x.lua.
Adding New Entities
<Entity Name="MyEnity" Script="Scripts/Entities/Others/MyEnity.lua" />
And a corresponding .lua file which implements the following methods:
-- Class MyEnity
MyEntity = {
Editor =
{
Icon = "MyIcon.bmp" -- icon for the editor (stock icons are under Editor/ObjectIcons)
},
Properties =
{
object_3DModel = "path/to/MyModel.cgf",
},
}
function MyEntity:OnInit()
self:OnReset()
end
function MyEntity:OnReset()
--this will set the selected 3D Model on the entity
if (self.Properties.object_MyModel ~= "") then
self:LoadObject(0, self.Properties.object_3DModel);
end
end
Now if you open the editor you'll be able to place your entity on the map from the Entities/Others menu.
How to add Read More option?
ReplyDeleteIn the editor, it looks like a page being ripped in half.
ReplyDelete