james227uk Posted August 8, 2010 Share Posted August 8, 2010 Hi, I was just wondering what the difference between init_object and create_object was. Is there even a difference? James227uk Link to comment Share on other sites More sharing options...
Seemann Posted August 8, 2010 Share Posted August 8, 2010 The only difference is that 0107 additionally calls CEntity::getDistanceFromCentreOfMassToBaseOfModel() So, I guess it's somehow related to the way the model is spawned. Probably if a part of the model is within another solid object (ground) the game changes its spawn location or not. Sanny Builder 3 • SA Memory Handling • OpenIV • gtamodding.com CLEO.li - The CLEO Library - Official site Link to comment Share on other sites More sharing options...
james227uk Posted August 8, 2010 Author Share Posted August 8, 2010 Thanks for that, It appears then, that init_object is the opcode i need. Link to comment Share on other sites More sharing options...
Deji Posted August 8, 2010 Share Posted August 8, 2010 In my experience, I found "init_object" never needs the model to be loaded before use... It loads automatically as you get close to its area. It fades into view when the player is close enough, so doesn't exist when the player is elsewhere, which saves game memory. Its collision seems to always exist, though... Causing that annoyance of "aghh, I can't see it but I can crash into it"... Hmmm.. Link to comment Share on other sites More sharing options...
james227uk Posted August 8, 2010 Author Share Posted August 8, 2010 I've been using create_object quite considerably, and haven't loaded the model. No crashes as of yet Link to comment Share on other sites More sharing options...
spaceeinstein Posted August 8, 2010 Share Posted August 8, 2010 Both opcodes are nearly identical in every way. Seeing the one difference between the two opcodes is most noticeable when spawning the "electric gate." One opcode places the gate higher than the other (forgot which one). Here are the native functions in IV that I think are equivalent to the opcodes: CREATE_OBJECT CREATE_OBJECT_NO_OFFSET Link to comment Share on other sites More sharing options...
Deji Posted August 8, 2010 Share Posted August 8, 2010 Nice... I'll add that to Opcode Database 2.0 Link to comment Share on other sites More sharing options...
james227uk Posted August 8, 2010 Author Share Posted August 8, 2010 Both opcodes are nearly identical in every way. Seeing the one difference between the two opcodes is most noticeable when spawning the "electric gate." One opcode places the gate higher than the other (forgot which one). Here are the native functions in IV that I think are equivalent to the opcodes:CREATE_OBJECT CREATE_OBJECT_NO_OFFSET It seemed to me that create_object is the one that spawns higher than the other Link to comment Share on other sites More sharing options...