Dwight
Member
|
Inserting character in world
Hi all,
Back in the day, this used to work to insert a character into the world:
Code:
void create(Int ID, Str name, Vec2 position, Flt scale)
{
Game::ObjParams obj;
obj.create(*Game::Objs(UID(xx, xx, xx, xx)));
obj.scale (true, scale);
obj.matrix.pos.x = position.x;
obj.matrix.pos.z = position.y;
obj.matrix.pos.y = Game::World.hmHeight(position);
UID uid;
uid.fromText(L"OBJ_CHR");
obj.type(true, uid);
super::create(obj);
Name = name;
this->ID = ID;
ctrl.actor.mass(1).kinematic(true).collision(true).group(ACTOR_NPC).obj(this);
}
This is what my old code has to insert a character into the world (server sided AI). I have issues finding the equivalent of "Game::ObjParams" [I thought it was ObjectPtr?].
How can I insert a character, like the example above, in the world through code?
|
|
04-16-2021 01:33 PM |
|
Dwight
Member
|
RE: Inserting character in world
Hi Zervox,
Thanks for the information! I should now just debug why spawning that NPC makes my client crash, but it's progress!
Good to see you lurking and posting here sometimes!
|
|
04-17-2021 05:15 PM |
|