lfnetwork.com mark read register faq members calendar

Thread: How do I set the position of a entity?
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 12-17-2007, 01:55 PM   #1
dnifan
Rookie
 
Join Date: Dec 2007
Posts: 11
How do I set the position of a entity?

Well, there's my question, I really hope someone can answer it as I've been busy with it for almost a week now. And I just can't seem to get the solution.

Thanks
dnifan is offline   you may: quote & reply,
Old 12-17-2007, 05:59 PM   #2
DarthDie
Junior Member
 
DarthDie's Avatar
 
Join Date: May 2005
Location: The Matrix
Posts: 407
You need to unlink the entity, set origin, then link again. Right? trap_UnlinkEntity, trap_LinkEntity, ent->r.currentOrigin .


OJP Sponsors and websites

"...and what about all those screenshots in there of DarthDie with a swastika of demo charges."
DarthDie is offline   you may: quote & reply,
Old 12-18-2007, 09:47 AM   #3
dnifan
Rookie
 
Join Date: Dec 2007
Posts: 11
I already tried that, and other numerous possibilities. Unfortunately, they failed.
dnifan is offline   you may: quote & reply,
Old 12-18-2007, 12:59 PM   #4
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
I don't think you need to relink an object to move positions like that. From what I remember, I think there's a SetOrigin function that does all the hard work for you.

Where in the code are you trying to do this?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 12-18-2007, 04:34 PM   #5
dnifan
Rookie
 
Join Date: Dec 2007
Posts: 11
I need to reposition a entity that has no position yet. Already linked.
You mean G_SetOrigin(gentity_t *ent, vec3_t *pos) right?
Well, I already tried that :P Doesn't work.
dnifan is offline   you may: quote & reply,
Old 12-19-2007, 12:18 AM   #6
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
How was the entity created?


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 12-20-2007, 09:51 AM   #7
dnifan
Rookie
 
Join Date: Dec 2007
Posts: 11
G_Spawn(), and then a G_InitEntity (or something like that)
dnifan is offline   you may: quote & reply,
Old 12-20-2007, 01:38 PM   #8
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
hmmm, that should work. maybe something else if preventing it from happening. What sort of object are you creating?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 12-20-2007, 05:24 PM   #9
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
You shouldn't need to G_InitEntity.

G_SetOrigin should work if you know an origin to set it to, like say the player's origin and then maybe move it out a ways by factoring in the YAW portion of viewangles.

you dont use G_SetOrigin(yournewentity, yournewentity->s.origin) you would choose some local variable or base it off of something that already exists.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > How do I set the position of a entity?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:05 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.