Log in

View Full Version : NPC sync



foxtacles
12-25-2012, 05:35 PM
https://i.imgur.com/EOw34.jpg

Spawning of NPCs / items via scripts. There is no AI yet (they just stand still), but general stuff like health / death / inventory / sex / age / appearance (everything which is synced for players too) is synced.

roby65
12-25-2012, 05:39 PM
Recy, you always surprise me.
Awesome work!

Silentfood
12-25-2012, 06:18 PM
Nice one! :D

Smoria
12-25-2012, 06:43 PM
MARVELOUS! Really good work!

JGee215
12-25-2012, 07:41 PM
Wow, truly amazing work! I'm incredibly impressed with how far the project has come in such a short amount of time, great work Recy this looks honestly incredible

Volumed
12-25-2012, 08:36 PM
A glorious victory!

NeoPhoenix
12-26-2012, 03:14 AM
they look like zombies^^ hehe nice one

Opex
12-26-2012, 05:41 AM
Brilliant!

Xolitude
12-26-2012, 06:25 PM
Lovin' it bro :D

foxtacles
12-30-2012, 07:09 PM
State VAULTSCRIPT OnPlayerChat(ID player, RawString message) noexcept
{
if (!std::strcmp(message, "iamrich"))
{
static Base bottlecap = static_cast<Base>(0x0F);

for (unsigned short i = 0; i < USHRT_MAX; ++i)
{
Item::Create(bottlecap, player);
std::printf("%d\r", i + 1);
std::fflush(stdout);
}
}

return True;
}

Yes, it works. Fallout 3 framerate drops to like 0.5 FPS though

PolGhost
01-04-2013, 03:11 PM
How to create a NPC to Pawn?

foxtacles
01-04-2013, 03:14 PM
native CreateActor(actor, ID, cell = 0, Float:X = 0.00, Float:Y = 0.00, Float:Z = 0.00);

You can either spawn at an ID or give the coordinates yourself. So this are the two ways of calling:

CreateActor(actor, ID);
CreateActor(actor, 0, cell, Float:X, Float:Y, Float:Z);

PolGhost
01-04-2013, 03:16 PM
Ok, Thanks you.

PolGhost
01-05-2013, 02:10 AM
Please write some sample code to spawn NPC on Pawn.

foxtacles
01-05-2013, 02:57 AM
public OnPlayerChat(ID, message{})
{
CreateActor(0x30D82, ID); // spawning Carter at ID (the player who typed something)
return 1;
}

I think it is really straightforward.

PolGhost
01-05-2013, 03:02 AM
Thanks you.

JGee215
01-05-2013, 02:42 PM
Hey Recy I was wondering if you've implemented ragdoll or physics synchronization yet to the mod, I figured because since AI is synced now could players all see the same body and loot the body?

Volumed
01-05-2013, 03:20 PM
Hey Recy I was wondering if you've implemented ragdoll or physics synchronization yet to the mod, I figured because since AI is synced now could players all see the same body and loot the body?

ragdoll or physics synchronization is really hard to create, but you can already loot and see the same body it have nothing to do with the AI sync but npc sync.