Jump to content

[SA]024F and 04D5 (corona creation)


Recommended Posts

Can't find the old SA opcode topic, so if someone wants to merge, feel free.

So after hours of trying to figure out why I could only get two coronas on the screen at the same time, turns out 04D5 is limited to just two coronas. 024F doesn't seem to have this restriction, moving or otherwise.

I should note this only happened to ME, coding in C++ with the script hook. For example:

CoLoop2:    SCRIPT_WAIT(0);    CallOpcode(&move_object_xyz, pFObj1->GetObj(), fFO1X, fFO1Y, fFO1Z2, 0.0f, 0.0f, 0.052f, 0);    CallOpcode(&get_object_pos, pFObj1->GetObj(), &fFO1X, &fFO1Y, &fFO1Z);    CallOpcode(&add_corona, fFO1X, fFO1Y, fFO1Z, 0.5f, 1, 0, 200, 0, 0);    elapsed_time =::GetTickCount() - Start_point;    //if (elapsed_time > 3000)    {CallOpcode(&move_object_xyz, pFObj2->GetObj(), fFO2X, fFO2Y, fFO2Z2, 0.0f, 0.0f, 0.052f, 0); CallOpcode(&get_object_pos, pFObj2->GetObj(), &fFO2X, &fFO2Y, &fFO2Z);    CallOpcode(&add_corona, fFO2X, fFO2Y, fFO2Z, 0.5f, 1, 0, 0, 200, 0);}    elapsed_time =::GetTickCount() - Start_point;    //if (elapsed_time > 6000)    {CallOpcode(&move_object_xyz, pFObj3->GetObj(), fFO3X, fFO3Y, fFO3Z2, 0.0f, 0.0f, 0.052f, 0);    CallOpcode(&get_object_pos, pFObj3->GetObj(), &fFO3X, &fFO3Y, &fFO3Z);    CallOpcode(&add_corona, fFO3X, fFO3Y, fFO3Z, 0.5f, 1, 0, 0, 0, 250);}    elapsed_time =::GetTickCount() - Start_point;    //if (elapsed_time > 7000)    {CallOpcode(&move_object_xyz, pFObj4->GetObj(), fFO4X, fFO4Y, fFO4Z2, 0.0f, 0.0f, 0.052f, 0);   CallOpcode(&get_object_pos, pFObj4->GetObj(), &fFO4X, &fFO4Y, &fFO4Z);    CallOpcode(&add_corona, fFO4X, fFO4Y, fFO4Z, 0.5f, 1, 0, 250, 200, 0);}    elapsed_time =::GetTickCount() - Start_point;    //if (elapsed_time > 10000)    {CallOpcode(&move_object_xyz, pFObj5->GetObj(), fFO5X, fFO5Y, fFO5Z2, 0.0f, 0.0f, 0.052f, 0);    CallOpcode(&get_object_pos, pFObj5->GetObj(), &fFO5X, &fFO5Y, &fFO5Z);    CallOpcode(&add_corona, fFO5X, fFO5Y, fFO5Z, 0.5f, 1, 0, 100, 100, 250);}    elapsed_time =::GetTickCount() - Start_point;//if (elapsed_time > 13000)

etc, gets all my stuff onscreen with 024F (defined as add_corona in my script). Again, did not test with Sanny as I tend not to use it (great program, super usful to me for figuring out how code works so I can convert it), so your milage may vary. Just wanted to put it out there in case anyone else is having an issue with this.

Link to comment
https://gtaforums.com/topic/765808-sa024f-and-04d5-corona-creation/
Share on other sites

04D5 is a fairly specialized function, defined by Rockstar as DRAW_WEAPONSHOP_CORONA - such a limitation seems likely, indeed.

 

Also, that seems to be an interesting workaround for the issue related to what I had recommended coronas for - seems as if you're attaching invisible objects to body parts to get their world position? Fun! :)

Edited by NTAuthority

I actually abandoned the coronas on an actor due to the 2d nature of them; body parts would clip through them depending on where I faced the camera. But I did still need this for something else, so I got the position of the actors in question and created the invisible objects, then put it all in its own thread so it looks like the coronas are moving on their own. Wound up with 45 on screen, moving at different times, looks really cool. Will be whipping up a vid for a few of you as a demo/thanks once I get the coding end done. :)

Edited by ceedj

body parts would clip through them depending on where I faced the camera

as a hack you might be able to set the 'ignore Z buffer' flag on the coronas (and use SilentPatch as that flag is broken in the stock game) by hacking the script function's implementation, though

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.