dnifan Posted December 17, 2007 Share Posted December 17, 2007 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 Link to comment Share on other sites More sharing options...
DarthDie Posted December 17, 2007 Share Posted December 17, 2007 You need to unlink the entity, set origin, then link again. Right? trap_UnlinkEntity, trap_LinkEntity, ent->r.currentOrigin . Link to comment Share on other sites More sharing options...
dnifan Posted December 18, 2007 Author Share Posted December 18, 2007 I already tried that, and other numerous possibilities. Unfortunately, they failed. Link to comment Share on other sites More sharing options...
razorace Posted December 18, 2007 Share Posted December 18, 2007 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? Link to comment Share on other sites More sharing options...
dnifan Posted December 18, 2007 Author Share Posted December 18, 2007 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 Doesn't work. Link to comment Share on other sites More sharing options...
ensiform Posted December 19, 2007 Share Posted December 19, 2007 How was the entity created? Link to comment Share on other sites More sharing options...
dnifan Posted December 20, 2007 Author Share Posted December 20, 2007 G_Spawn(), and then a G_InitEntity (or something like that) Link to comment Share on other sites More sharing options...
razorace Posted December 20, 2007 Share Posted December 20, 2007 hmmm, that should work. maybe something else if preventing it from happening. What sort of object are you creating? Link to comment Share on other sites More sharing options...
ensiform Posted December 20, 2007 Share Posted December 20, 2007 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.