Jump to content

Trying To Make A Stinger Drop Mod


demonj0e

Recommended Posts

Hey all

ive been trying to make your car in sa be able to drop them stinger things used in punture wounds

 

ive tried making sum code but game crashes when cj enters a vehicle

 

 

:STINGERMOD03A4: name_thread 'STINGER':STINGERCHECK0001:wait  0 ms00D6: if  000DF:   actor $PLAYER_ACTOR driving004D: jump_if_false ££STINGERCHECK0247: request_model #TEMP_STINGER20004: $7416 =  3 ;; integer values03C0: @0 = actor $PLAYER_ACTOR car:STINGERADD038B: load_requested_models00D6: if  00248:   model #TEMP_STINGER2 available004D: jump_if_false ££STINGERADD00D6: if  000E1:   key_pressed  0  17004D: jump_if_false ££STINGERADD0407: create_coordinate @6 @7 @8 from_car @0 offset  0.0 -3.0 -.5 0174: @3 = car @0 z_angle0009: @3 +=  90.0 ;; floating-point values02CE: @1 = ground_z @6 @7 @80107: @2 = create_object #TEMP_STINGER2 at @6 @7 @80177: set_object @2 z_angle_to @3097A: @6 @7 @8  1125 0006: @9 =  1 ;; integer values000C: $7416 -=  1 ;; integer values0006: @10 =  0 ;; integer values:STINGERFINNISH0108: destroy_object @201C3: remove_references_to_car @0 ;; Like turning a car into any random car0249: release_model #TEMP_STINGER20002: jump ££STINGERMOD

 

 

ive used most of the code from the punture wounds mission but i just cant see why the game is crashing when he enters a vehicle

Link to comment
Share on other sites

You better asked patrickW, or stop, because PatrickW has made this mod already, it's 4 VC aND sa, I thought dozingoff.gif

Link to comment
Share on other sites

I'm not familiar with Patrick making such a mod, though I was gone for a while. I WAS just on his site recently and I didn't see such a thing. I know it was talked about by others before (making a Stinger mod for SA).

 

Here's the problems as I encounter them:•no if player defined check

•low priority loop with a 0 wait

•$7416 = 3; use custome labels, not DMA. I haven't bothered to check what $7416 is, but I know it doesn't belong to your mod, so you shouldn't be telling it to access it. By the looks of the way you use it later, it appears to be that mission's way of tracking a quantity. However, if you've never run that mission, the var is undefined and MAY crash the game.

•no need to loop the load requested models command

•but there IS a need for a loop to have a wait, a likely candidate for your crash

•your lumping of model readiness and keypress check is inaccurate. If you want the model to always be loaded when player is driving, then the keypress check should have its own check

•once you've added 90 to your angle, you should check if it's greater than 359.99 and if so, subtract 360 from it. However, my understanding is that the engine can handle angles grater than 360 anyways

•you have @1 capturing ground z, but @8 is what you used for the z offset, just as @8 is what you went ahead and used for your place Z value. It would be more accurate to change the line @1 = ground z to @8

•@9 and @10 are unused by your mod, so I'm not sure why there are lines setting them to anything

•your final jump jumps back to the beginning of the thread instead of the beginning of the thread's loop. So you're looping the name_thread command which there is no reason for and really shouldn't be done.

•you release the model even though earlier in the mod, you appear to wish to keep it loaded for as long as you're driving

•you've captured the car you're driving, but there is not a single is car wrecked check.

•last but not least, you're eliminating your stinger as soon as you plant it. I would think you'd NEED some kind of tracking system.

 

We've covered stuff like this before and I mentioned then that if you don't understand any of it, to ask. Should probably look more like (untested, with tracking only for a single stinger; more should be easy through use of array)

:STINGERMOD03A4: name_thread 'STINGER':STINGERCHECK0001:wait  250 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££STINGERCHECK00D6: if  000DF:   actor $PLAYER_ACTOR driving004D: jump_if_false ££STINGERCHECK03C0: @0 = actor $PLAYER_ACTOR car0247: request_model #TEMP_STINGER2038B: load_requested_models:STINGERADD0001:wait  0 ms00D6: if  00248:   model #TEMP_STINGER2 available004D: jump_if_false ££STINGERADD:STINGERLOOP0001:wait  50 ms00D6: if  10256:   player $PLAYER_CHAR defined8119:   NOT   car @0 wrecked004D: jump_if_false ££STINGERPURGE00D6: if  000DB:   actor $PLAYER_ACTOR in_car @0004D: jump_if_false ££STINGERPURGE00D6: if  100E1:   key_pressed  0  170043:   @9 ==  0004D: jump_if_false ££STINGERLOOP0005: @9 =  10407: create_coordinate @6 @7 @8 from_car @0 offset  0.0 -3.0  0.00174: @3 = car @0 z_angle0009: @3 +=  90.0;; floating-point values00D6: if  00021:   @3 >  359.99004D: jump_if_false ££STINGERCONT000F: @3 -=  360.0:STINGERCONT02CE: @1 = ground_z @6 @7 @80107: @2 = create_object #TEMP_STINGER2 at @6 @7 @10177: set_object @2 z_angle_to @3097A: @6 @7 @1  11250002: jump ££STINGERLOOP:STINGERPURGE00D6: if  00043:   @9 ==  1004D: jump_if_false ££STINGERPURGE201C4: remove_references_to_object @20005: @9 =  0:STINGERPURGE201C3: remove_references_to_car @00249: release_model #TEMP_STINGER20002: jump ££STINGERCHECK

 

Link to comment
Share on other sites

lol yes that was very sloppy code from me it was like 1am when i made that and i got up early in morning cuz sister was puking up so i was realy tired when i posted it so i didnt realy notice much

thankyou dem ill try some more now biggrin.gif

 

ook k big thanks working now iv gotta do a few check to make sure hes not driving a bike boat or helicopter and also how would i get it to delete the stinger after the player leaves the area?

wil try some stuf now and post some updates

Edited by demonj0e
Link to comment
Share on other sites

You will now that PatrickW dutch is, he release the mod on GTAgames.nl, so, and he released it on that site

 

 

Link to comment
Share on other sites

how would i get it to delete the stinger after the player leaves the area?

sigh.gif You already know how.

 

@Bear: Even if Patrick has done this already, there's nothing wrong with people learning how on their own.

Link to comment
Share on other sites

You can't tell by reading the code? confused.gif Not sure I can help you then. Good thing I didn't try to make it support multiples first thing. Would've wasted a lot of my time.
Link to comment
Share on other sites

no sorry its just not my day horrible weather making me realy bored and cant concentrate propely is it summin to do with the @9 == 1 part?
Link to comment
Share on other sites

Setting @9 to 1 when you drop a stinger accomplishes two things. First of all, it prevents you from dropping another since that code is only equipped to handle one stinger. Secondly, it lets the cleanup section of code know that the object has been created and needs to be relieved as well.
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.