interactive_entities - ryzom/ryzomcore GitHub Wiki


title: Interactive Entities description: published: true date: 2023-03-01T05:20:14.879Z tags: editor: markdown dateCreated: 2022-03-11T00:12:32.612Z

Notes for adding new types of entities with specific interactivity (working doors with dynamic collision, etc).


ryzom_entity_id.h specifies

RYZOMID::TTypeId::npc

etcetera


Entity properties sent specified by

distance_prioritizer.cpp ln 309 etc

WARNING: Default is to send ALL properties!!

BUG??? This code currently only checks for npc, creature and forageSource!! We also have mount, pack_animal, flora, object, building, position, ...


  • Mirror.declareEntityTypeOwner( RYZOMID::player, MaxNbPlayers );
  • Mirror.declareEntityTypeOwner( RYZOMID::object, MaxNbObjects );
  • Mirror.declareEntityTypeOwner( RYZOMID::npc, MaxNbNpcSpawnedByEGS );
  • Mirror.declareEntityTypeOwner( RYZOMID::forageSource, MaxNbForageSources );
  • Mirror.declareEntityTypeOwner( RYZOMID::fx_entity, MaxNbToxicClouds );
  • Mirror.declareEntityTypeOwner( RYZOMID::civilisation, 10 ); // max number of civilisation
  • Mirror.declareEntityTypeOwner( RYZOMID::guild, MaxNbGuilds ); // max number of guild (total number of unified guilds)
  • Mirror.declareEntityTypeOwner( RYZOMID::fame_memory, MaxNbPlayers ); // max number of fame_memory (one by connected player)

We also have this business here

#!c


	case CEntitySheet::RACE_STATS:
	case CEntitySheet::CHAR:
		if (slot == 0)
		{
			nlassert (UserEntity == NULL);
			UserEntity = new CUserEntity;
			_Entities[slot] = UserEntity;
		}
		else
		{
			_Entities[slot] = new CPlayerCL;
		}
		break;

	case CEntitySheet::FAUNA:
	{
		CCharacterSheet *sheet = NLMISC::safe_cast<CCharacterSheet *>(entitySheet);
		if (!sheet->R2Npc) _Entities[slot] = new CCharacterCL;
		else _Entities[slot] = new CPlayerR2CL;
	}
	break;
	case CEntitySheet::FLORA:
		_Entities[slot] = new CCharacterCL;
		break;

	case CEntitySheet::FX:
		_Entities[slot] = new CFxCL;
		break;

	case CEntitySheet::ITEM:
		_Entities[slot] = new CItemCL;
		break;

	case CEntitySheet::FORAGE_SOURCE:
		_Entities[slot] = new CForageSourceCL;
		break;


This bunch seems to be dead code as well

#!c

class CItemCL : public CEntityCL
{
protected:
	/// Update the item position.
	virtual void updateVisualPropertyPos(const NLMISC::TGameCycle &gameCycle, const sint64 &prop, const NLMISC::TGameCycle &pI);

public:
	NLMISC_DECLARE_CLASS(CItemCL);

	/// Constructor
	CItemCL();

	/// Constructor
	CItemCL( const std::string &fileName );

	/// Destructor
	~CItemCL();

	/**
⚠️ **GitHub.com Fallback** ⚠️