An aspect represents some characteristic of an entity.
The basic entity does nothing besides exist in some location, it cannot be interacted with in any way without aspects attached to it.
There are many many aspects, and programming in ops mostly involves creating them. Some of them are old and unused, while many are very important.
Aspects
- nfsm - subclass this for aspects build around a finite state machine - ai classes come from this
- aspect
- narmor - allow them to take damage
- nfragment - create another entity when this one is destroyed
- nhardpoint - a place for other entites to attach themselves (driving seat / missle, turret location)
- nside - should be a server - this manages an entire sides units
- nsoundemitter - produces positional sound
- nttl - destroys the ent after some time limit
- nweapon - fires weapons
- nweapongroup - links weapons together
- physics
- nphysics - the default physics model
- ncollisionnode - holds a collision mesh
- ncollisionresponse - responds to collisions - applies forces
- nconstantforce - applies constant forces - gravity
- ngroundcoll - collides an object with the terrain
- nodephysics - ode physics model wrapped in an aspect
- nodecollision response - responds to collision with nodephysics
- noffsetaspect - subclass this for aspects that exist at some point offset from the main entity (engines)
- nstabilizer - keeps the entity pointing up
- ai - ai behaviors are aspects too
- ncontroller - the default ai root
- nmoveai - basic move to 3d point
- rts - things created for aftermath
- nhoverengine - additional hovercraft physics
- nhovermelee - ai controlling tanks in melee combat
- nhovermove - move to destination
- nrtscamera - restricts the cam
- nturretai - controlls the turrets
- nshipai - overrides controller
Adding Aspects
sel /game/ents/rock/rock0
new nphysics physics
sv force 0 10 0
this will attach the default rigid body physics to the entity, allowing you to push / pull on it all you want.
sv force will then apply an instantaneous force on the object - if you want a consant force use the constantforce aspect
There is a whole number of aspects, writing them forms the bulk of the c coding done for projects in the ops engine.
You can look through them in the code/aspects,physics,ai directories
|