Page 1 of 1

Floating items

Posted: Mon Jul 28, 2008 4:31 pm
by nexus024
Is it possible to add in a item at any point in the map and have it float at a pre-defined position in the air?

Re: Floating items

Posted: Mon Jul 28, 2008 7:40 pm
by ^misantropia^

Code: Select all

ent->spawnflags |= 1;
G_SetOrigin(ent, ent->s.origin);
From FinishSpawningItem() in game/g_items.c

Re: Floating items

Posted: Mon Jul 28, 2008 8:24 pm
by nexus024
I see this code inside g_items.c

Code: Select all

if ( ent->spawnflags & 1 ) {
  G_SetOrigin( ent, ent->s.origin );
}

I don't understand though how I can add an item that isn't already in the map with this code.

Re: Floating items

Posted: Tue Jul 29, 2008 11:11 am
by corncobman
Look at how the items are spawned in g_item.c

Re: Floating items

Posted: Thu Jul 31, 2008 5:02 pm
by nexus024
Ok, I'll have to research into what is going on in those functions.