Jump to content

Car.Destroy


HeresOtis

Recommended Posts

 

// part of code0169: set_fade_color_RGB 0 0 0fade 0 3000 wait 3000 Marker.Disable(90@(110@,20i))Car.Destroy(50@(110@,20i))Actor.DestroyInstantly(70@(110@,20i))Car.RemoveReferences(50@(110@,20i))Actor.RemoveReferences(70@(110@,20i))wait 1000 fade 1 2000 wait 2000// rest of code

 

 

Why does this crash when during a fade? Once when fade is complete, when it's completely black the game crashes. It's something to do with Actor.DestroyInstantly & Car.Destroy. When I take those out and leave Marker.Disable, Actor.RemoveReferences, & Car.RemoveReferences, there's no crash. I evened try to use

00A1: put_actor 70@(110@,20i) at 345.5621 306.2212 998.448400AB: put_car 50@(110@,20i) at -1577.942 52.6333 40.0

so it would put them over the ocean and then remove references, but they still stay in the same place or my game crashes.

 

 

 

 

Link to comment
Share on other sites

spaceeinstein

How many cars and actors are you creating to warrant the usage of such large variables? Seeing a tiny fragment of your code does not say much, please post your entire code.

Link to comment
Share on other sites

Well, I made a LCPDFR for San Andreas called SAPDFR. This code is part of the pursuit, which is as a cleo mission. The code is too long and I don't want people trying to steal it. But here's a snippet:

 

 

_MSSN_3545wait 0 if 0741:   actor 1@ busted else_jump @PP_MSSN_2568 00BE: text_clear_all 067C: put_camera_on_actor 1@ with_offset -10.0 -7.0 8.0 rotation 0.0 0.0 0.0 tilt 0.0 mode 2 0952: load_soundtrack 12 0954: start_playing_loaded_soundtrack 00BA: show_text_styled GXT 'SCN56' time 6750 style 3 wait 4000 Player.CanMove($PLAYER_CHAR) = False0169: set_fade_color_RGB 0 0 0 fade 0 2750 wait 3000 110@ = 0 gosub @PP_MSSN_3974            /////// thread belowgosub @PP_MSSN_3845            /////// thread belowMarker.Disable(14@)Car.Destroy(0@)                    <---------   This is where the crash isActor.DestroyInstantly(1@)     <----------  Here tooCar.RemoveReferences(0@)Actor.RemoveReferences(1@)wait 1000 fade 1 2000 wait 50 $ONMISSION = 0 Camera.SetBehindPlayerCamera.Restore_WithJumpCutPlayer.CanMove($PLAYER_CHAR) = Truewait 1950 mission_cleanup return////////////////// gosubs /////////////////:PP_MSSN_3845wait 0 if   Actor.Defined(11@)else_jump @PP_MSSN_3886 wait 10 Actor.DestroyInstantly(11@)Actor.RemoveReferences(11@)jump @PP_MSSN_3886 _MSSN_3886wait 0 if   Actor.Defined(12@)else_jump @PP_MSSN_3927 wait 10 Actor.DestroyInstantly(12@)Actor.RemoveReferences(12@)jump @PP_MSSN_3927 _MSSN_3927wait 0 if   Actor.Defined(13@)else_jump @PP_MSSN_3968 wait 10 Actor.DestroyInstantly(13@)Actor.RemoveReferences(13@)jump @PP_MSSN_3968 _MSSN_3968wait 50 return _MSSN_3974wait 0 if  19 > 110@ else_jump @PP_MSSN_4095 if and  Actor.Defined(70@(110@,20i))  Car.Defined(50@(110@,20i))else_jump @PP_MSSN_4081 wait 10 Marker.Disable(90@(110@,20i))Car.Destroy(50@(110@,20i))                        <--- No crash on these, but the cars/actors arent destroyed, theyre still  Actor.DestroyInstantly(70@(110@,20i))         <--- at the same position, but the removereferences still go throughCar.RemoveReferences(50@(110@,20i))Actor.RemoveReferences(70@(110@,20i))jump @PP_MSSN_4081 _MSSN_4081110@ += 1 jump @PP_MSSN_3974 _MSSN_4095wait 50 return

 

Link to comment
Share on other sites

Well for starters, "remove references" does zilch if you have already deleted the entity.

Link to comment
Share on other sites

Well for starters, "remove references" does zilch if you have already deleted the entity.

Well, when you use Actor.DestroyInstantly and Car.Destroy does that remove them from game memory?

Link to comment
Share on other sites

Tak.

Link to comment
Share on other sites

I think I solved my problem.

One more question, how do you remove a styled text

 

00BA: show_text_styled GXT 'BEEFY' time 1000 style 2  // Beefy Baron

 

 

No matter how many seconds I put it for, it just always stay on the screen. Even after a fade.

Which opcode am I supposed to use to remove?

Link to comment
Share on other sites

03D6: remove_styled_text 'BOXBURG'

 

Link to comment
Share on other sites

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
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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