Jump to content

MISSION CREATED (ALMOST)


Recommended Posts

2pacproducer

Hi ! I tryed to create a mission in a start of the game. So I defined mission 135:

 

 

DEFINE MISSIONS 136...DEFINE MISSION 135 AT @NONAME

 

 

And created sphere :

 

 

:MAIN_240$10948 = Marker.CreateIconAndSphere($ICON_CJ, 2259.107, -1262.764, 23.97265):MAIN_241if 0101: actor $PLAYER_ACTOR stopped_near_point 2259.107 -1262.764 23.97265 radius 4.0 4.0 6.0 sphere 0 jf @MAIN_241start_mission 135

 

 

And maked a 135 mission thread under the mission 134 and started creating mission :

 

 

//-------------Mission 135---------------:NONAMEthread "NONAME" gosub @NONAME_37 if wasted_or_busted jf @NONAME_37 gosub @NONAME_576 :NONAME_3702A3: toggle_widescreen 1 Player.CanMove($PLAYER_CHAR) = FalseCamera.SetPosition(2255.284, -1259.219, 23.96705, 0.0, 0.0, 0.0)Camera.PointAt(2261.162, -1260.906, 23.97656, 2)wait 5000 jump @NONAME_111 :NONAME_111Model.Load(#BMYCR)Model.Load(#GREENWOO)038B: load_requested_models :NONAME_122if or  not Model.Available(#BMYCR)  not Model.Available(#GREENWOO)jf @NONAME_153 wait 0 jump @NONAME_122 :NONAME_1530792: (unknown) $PLAYER_ACTOR Actor.PutAt($PLAYER_ACTOR, 2259.107, -1262.764, 23.97265)1@ = Car.Create(#GREENWOO, 2264.231, -1261.071, 23.97656)01C8: 2@ = create_actor 21 #BMYCR in_car 1@ passenger_seat 2 wait 5000 02A3: toggle_widescreen 0 Player.CanMove($PLAYER_CHAR) = TrueCamera.SetBehindPlayerCamera.Restore_WithJumpCut$10949 = Marker.CreateAboveCar(1@)if   Car.Wrecked(1@)jf @NONAME_266 jump @NONAME_576 :NONAME_266if 05CB: AS_actor $PLAYER_CHAR enter_car_as_driver 1@ 10000 ms jf @NONAME_266 jump @NONAME_295 :NONAME_295$PLAYER_CHAR = Marker.CreateIconAndSphere($ICON_CJ, 2509.052, -1677.298, 13.42085):NONAME_318if 0103:   actor $PLAYER_CHAR stopped_near_point_in_car 2509.052 -1677.298 13.42085 radius 4.0 4.0 6.0 sphere 0 jf @NONAME_318 jump @NONAME_373 :NONAME_37302A3: toggle_widescreen 1 Player.CanMove($PLAYER_CHAR) = FalseCamera.SetPosition(2511.93, -1673.103, 13.48046, 0.0, 0.0, 0.0)Camera.PointAt(2514.552, -1680.65, 13.43769, 2)wait 5000 05CD: AS_actor 2@ exit_car 1@ wait 1000 :NONAME_45305D3: AS_actor 2@ go_to 2524.616 -1688.027 13.56309 speed 4 3000 ms wait 0 if 0101:   actor 2@ stopped_near_point 2524.616 -1688.027 13.56309 radius 2.0 2.0 0.0 sphere 0 jf @NONAME_453 02A3: toggle_widescreen 0 Player.CanMove($PLAYER_CHAR) = TrueActor.PutAt($PLAYER_ACTOR, 2259.107, -1262.764, 23.97265)0318: set_latest_mission_passed 'NONAME' mission_cleanup return :NONAME_57600BA: text_styled 'M_FAIL' 5000 ms 1  // ~r~MCC• ’POBA‚EHA!return 

 

 

But the game crashes !

 

Can someone check my codes and fix some problems ? (If there is problems offcourse)

Link to comment
https://gtaforums.com/topic/306514-mission-created-almost/
Share on other sites

I have had the same problem some times ago. I think that the game return to the previously label that contain the go_to opcode. So the animation is loaded and overwrited until the actor reaches the destination. Find and change the thread named "NONAME_453".

 

:NONAME_39305D3: AS_actor 2@ go_to 2524.616 -1688.027 13.56309 speed 4 3000 ms:NONAME_453wait 0if0101:   actor 2@ stopped_near_point 2524.616 -1688.027 13.56309 radius 2.0 2.0 0.0 sphere 0jf @NONAME_45302A3: toggle_widescreen 0Player.CanMove($PLAYER_CHAR) = TrueActor.PutAt($PLAYER_ACTOR, 2259.107, -1262.764, 23.97265)0318: set_latest_mission_passed 'NONAME'mission_cleanupreturn 

 

Link to comment
https://gtaforums.com/topic/306514-mission-created-almost/#findComment-1057391367
Share on other sites

I believe that the mission crashes because at the very begining of the mission there is:

 

 

gosub @NONAME_37 if wasted_or_busted jf @NONAME_37 gosub @NONAME_576 

 

 

there is gosub @NONAME_37 and jf @NONAME_37

gosub and jump are processing (I couldnt think of another word) exactly the same data. I think this is a problem. If im wrong, someone smarter could correct me of course.

 

Link to comment
https://gtaforums.com/topic/306514-mission-created-almost/#findComment-1057392017
Share on other sites

2pacproducer
I believe that the mission crashes because at the very begining of the mission there is:

 

 

gosub @NONAME_37 if wasted_or_busted jf @NONAME_37 gosub @NONAME_576 

 

 

there is gosub @NONAME_37 and jf @NONAME_37

gosub and jump are processing (I couldnt think of another word) exactly the same data. I think this is a problem. If im wrong, someone smarter could correct me of course.

So , why you dont show me how it needs to be ?

Link to comment
https://gtaforums.com/topic/306514-mission-created-almost/#findComment-1057392074
Share on other sites

No, I won't - re-read this and all the following posts. It's the same mistake once again, this time in label :MAIN_241.

If you don't know how to fix it, don't even DREAM of coding a mission.

If you do remember the solution though, stop right here anyway - you still don't know anything about how the code (which you're copying from others or original code) works, or why it works the way it does. You weren't even able to clone the standard mission template (which is EXACTLY the same for all missions in GTA3, VC and SA ) properly. Do you see an end_thread in your code?

Me neither.

Do you know where the game engine continues execution of the code when it hits the RETURN opcode in :NONAME_453 or :NONAME_576?

No, you don't! You don't even grasp the concept of waits or loops and despite your obvious lack of knowledge in these most basic fields you try to code a MISSION, the supreme discipline of SCM coding. suicidal.gif

 

That is NOT the way to go. You won't get ANYWHERE this way - I wonder why you fail to understand that. If I were you I wouldn't try the most difficult things if I couldn't even get simple things to work. And PLEASE, don't open dozens of new threads for every little snippet of code that you managed to get all wrong again, especially if you don't post any kind of feedback like 'It works now and I understand why, thank you!' after we spent our precious time trying to point you in the right direction. The way it looks to me you just gave up every time and decided to try an even more advanced piece of code next time...

 

Look, when you want to learn coding you should just 'code' one-liners (pickups, car generators) first. Then, when you know how conditions and loops work in GTA, you do some keypress mods ('when I press this key combo a car is spawned') and so on, expanding your small threads the more you understand the structure of the code. THEN, when you know exactly how the code works and are able to follow and understand the threads in the original code, you can try coding a mission (which isn't too different from coding a thread, but sufficiently different to provide for some pitfalls).

There's NO other way of learning to code I'm afraid.

 

And I can't edit your code because it's broken beyond recognition - it would be faster to re-write it from scratch, which I'm not going to do.

Edited by SteaVor
Link to comment
https://gtaforums.com/topic/306514-mission-created-almost/#findComment-1057392541
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
  • 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.