IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 SA mission crash when busted or wasted

 
dennis48309  
Posted: Monday, Jul 30 2012, 09:53
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 30, 2012

XXXXX



I started with a stripped main.scm and built a thread that waits for a player to walk to a marker and it starts a mission. The mission is a very simple one, it spawns a car and 4 SWAT enemies with M4 weapons. The mission completes when you kill all three of them. Unfortunately, if you are busted or wasted on the mission, SA crashes. I have wasted hours trying to figure this out, please help me somebody, thank you. Here is the code on Pastebin: http://pastebin.com/cHQRgatF
PM
  Top
 

 
Bad.boy!  
Posted: Monday, Jul 30 2012, 10:14
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



You have to put it in mission format, look in your SB install directory.
PM
  Top
 

 
dennis48309  
Posted: Monday, Jul 30 2012, 17:28
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 30, 2012

XXXXX



I do not understand what you mean exactly. I have been reading the Sanny Builder help and I do not know what you meant by your statement. When you kill the 3 SWAT people, the mission ends and you get paid, but if you die or get arrested it crashes. Please, you are my only hope.
PM
  Top
 

 
SilentPL  
Posted: Monday, Jul 30 2012, 17:33
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




THIS helps with the mission structure.
Users WebsitePMMSNXbox Live
  Top
 

 
dennis48309  
Posted: Monday, Jul 30 2012, 17:59
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 30, 2012

XXXXX



I was reading that page yesterday but it did not help me. I understand the basics regarding threads and the mission loop. I actually removed the lines for If & wasted_or_busted. I don't understand why the mission works if you beat it, but if you die or get busted the game crashes. I have spent so many hours reading many different pages and have not come any closer to fixing this. Did you look at the code by chance? It is not very long and I would greatly appreciate it if you could give any hints on how to fix the crash.
PM
  Top
 

 
SilentPL  
Posted: Monday, Jul 30 2012, 18:24
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




QUOTE (dennis48309 @ Monday, Jul 30 2012, 19:59)
I don't understand why the mission works if you beat it, but if you die or get busted the game crashes.

It crashes because you are not using the damn proper structure. Follow this tutorial more carefully.
Users WebsitePMMSNXbox Live
  Top
 

 
dennis48309  
Posted: Tuesday, Jul 31 2012, 17:24
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 30, 2012

XXXXX



If you are so smart then please explain why the hell this stupid example does not loop. There is no loop! wasted_or_busted is checked once then the mission ends. I don't see how the hell this example structure is supposed to work, at least mine loops and does not end the thread until mission is complete or you die.

:MissionStart
03A4: name_thread 'NAME'
0050: gosub @MissionBegin
00D6: if
0112: wasted_or_busted
004D: jump_if_false @MissionEnd
0050: gosub @MissionFailed

:MissionEnd
0050: gosub @MissionCleanup
004E: end_thread

:MissionBegin
// This section is where you place the contents of your mission
0051: return

:MissionFailed
// This section is what happens after you died or got busted during your mission
0051: return

:MissionCleanup
// This section is where you clean up the contents of your mission so you can end it
0004: $ONMISSION = 0
00D8: mission_cleanup
0051: return
PM
  Top
 

 
SilentPL  
Posted: Tuesday, Jul 31 2012, 17:56
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




"If you are so smart", why not look at III/VC/SA missions and code it basing on this?
Users WebsitePMMSNXbox Live
  Top
 

 
dennis48309  
Posted: Tuesday, Jul 31 2012, 18:06
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 30, 2012

XXXXX



I really appreciate you giving me a useless mission structure that DOES NOT LOOP!
PM
  Top
 

 
SilentPL  
Posted: Tuesday, Jul 31 2012, 18:07
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




MAKE IT LOOP then. Inside MissionBegin.

R* uses it and it works. Magic, eh?
Users WebsitePMMSNXbox Live
  Top
 

 
dennis48309  
Posted: Tuesday, Jul 31 2012, 18:08
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 30, 2012

XXXXX



If you look at what I did, I made a tiny modification to this to make it loop. A mission that starts and the thread ends right away is completely useless. I adjusted my structure to mimic the one on the tutorial, with the addition of the loop.

:BLASTEM
03A4: name_thread 'BLASTEM'
$ONMISSION = 1
wait 0
0050: gosub @BLASTEM_BEGIN

:BLASTEM_LOOP
wait 0
00D6: if
0112: wasted_or_busted
004D: jump_if_false @BLASTEM_LOOP
0050: gosub @BLASTEM_FAILED

:BLASTEM_END
0050: gosub @BLASTEM_CLEAN
004E: end_thread

:BLASTEM_BEGIN
Model.Load(#COMET)
Model.Load(#SWAT)
Model.Load(#M4)
038B: load_requested_models

:BLASTEM_BEGIN2
if or
not Model.Available(#COMET)
not Model.Available(#SWAT)
not Model.Available(#M4)
else_jump @BLASTEM_BEGIN3
jump @BLASTEM_BEGIN2

:BLASTEM_BEGIN3
9@ = Car.Create(#COMET, 2440.6672, -1655.4305, 13.3432)

$789 = Actor.Create(CivMale, #SWAT, 2467.6672, -1655.4305, 13.3432)
$787 = Actor.Create(CivMale, #SWAT, 2470.6672, -1655.4305, 13.3432)
$786 = Actor.Create(CivMale, #SWAT, 2464.6672, -1655.4305, 13.3432)
0243: set_actor $789 ped_stats_to 1
01B2: give_actor $789 weapon 31 ammo 120
01B9: set_actor $789 armed_weapon_to 31
02E2: set_actor $789 weapon_accuracy_to 75
0243: set_actor $787 ped_stats_to 1
01B2: give_actor $787 weapon 31 ammo 120
01B9: set_actor $787 armed_weapon_to 31
02E2: set_actor $787 weapon_accuracy_to 75
0243: set_actor $786 ped_stats_to 1
01B2: give_actor $786 weapon 31 ammo 120
01B9: set_actor $786 armed_weapon_to 31
02E2: set_actor $786 weapon_accuracy_to 75
//$789 = Marker.CreateAboveActor($789)
//$787 = Marker.CreateAboveActor($787)
//$786 = Marker.CreateAboveActor($786)
077A: set_actor $789 acquaintance 4 to_actors_pedtype 0
077A: set_actor $787 acquaintance 4 to_actors_pedtype 0
077A: set_actor $786 acquaintance 4 to_actors_pedtype 0
0051: return

:BLASTEM_FAILED
// This section is what happens after you died or got busted during your mission
0051: return

:BLASTEM_CLEAN
// This section is where you clean up the contents of your mission so you can end it
0004: $ONMISSION = 0
00D8: mission_cleanup
0051: return
PM
  Top
 

 
SilentPL  
Posted: Tuesday, Jul 31 2012, 18:11
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




Nope. Do it like R* did it.

CODE
:BLASTEM
03A4: name_thread 'BLASTEM'
0050: gosub @BLASTEM_BEGIN
00D6: if
0112: wasted_or_busted
004D: jump_if_false @BLASTEM_END
0050: gosub @BLASTEM_FAILED

:BLASTEM_END
0050: gosub @BLASTEM_CLEAN
004E: end_thread

:BLASTEM_BEGIN
$ONMISSION = 1
Model.Load(#COMET)
Model.Load(#SWAT)
Model.Load(#M4)
038B: load_requested_models

:BLASTEM_BEGIN2
if or
not Model.Available(#COMET)
not Model.Available(#SWAT)
not Model.Available(#M4)
else_jump @BLASTEM_BEGIN3
0001: wait 0 ms
jump @BLASTEM_BEGIN2

:BLASTEM_BEGIN3
9@ = Car.Create(#COMET, 2440.6672, -1655.4305, 13.3432)

$789 = Actor.Create(CivMale, #SWAT, 2467.6672, -1655.4305, 13.3432)
$787 = Actor.Create(CivMale, #SWAT, 2470.6672, -1655.4305, 13.3432)
$786 = Actor.Create(CivMale, #SWAT, 2464.6672, -1655.4305, 13.3432)
0243: set_actor $789 ped_stats_to 1
01B2: give_actor $789 weapon 31 ammo 120
01B9: set_actor $789 armed_weapon_to 31
02E2: set_actor $789 weapon_accuracy_to 75
0243: set_actor $787 ped_stats_to 1
01B2: give_actor $787 weapon 31 ammo 120
01B9: set_actor $787 armed_weapon_to 31
02E2: set_actor $787 weapon_accuracy_to 75
0243: set_actor $786 ped_stats_to 1
01B2: give_actor $786 weapon 31 ammo 120
01B9: set_actor $786 armed_weapon_to 31
02E2: set_actor $786 weapon_accuracy_to 75
//$789 = Marker.CreateAboveActor($789)
//$787 = Marker.CreateAboveActor($787)
//$786 = Marker.CreateAboveActor($786)
077A: set_actor $789 acquaintance 4 to_actors_pedtype 0
077A: set_actor $787 acquaintance 4 to_actors_pedtype 0
077A: set_actor $786 acquaintance 4 to_actors_pedtype 0

while true
   0001: wait 0 ms
   // Put mission checks HERE
end
0051: return

:BLASTEM_FAILED
// This section is what happens after you died or got busted during your mission
0051: return

:BLASTEM_CLEAN
// This section is where you clean up the contents of your mission so you can end it
0004: $ONMISSION = 0
00D8: mission_cleanup
0051: return
Users WebsitePMMSNXbox Live
  Top
 

 
dennis48309  
Posted: Tuesday, Jul 31 2012, 18:14
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 30, 2012

XXXXX



I understand that I can make MissionBegin loop. That still does not help the part for checking if the player is busted or wasted. I really don't think you understand that the waste_or_busted check needs to be inside of a loop. It can't be checked only once, and it surely can't be checked after theMissionBegin finally ends.
PM
  Top
 

 
SilentPL  
Posted: Tuesday, Jul 31 2012, 18:15
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




QUOTE (dennis48309 @ Tuesday, Jul 31 2012, 20:14)
I understand that I can make MissionBegin loop.  That still does not help the part for checking if the player is busted or wasted.  I really don't think you understand that the waste_or_busted check needs to be inside of a loop.  It can't be checked only once, and it surely can't be checked after theMissionBegin finally ends.

Instead of telling me I don't understand how SCM works (I'm actually one of the people who understand it the best out there), TEST IT IN GAME.
Users WebsitePMMSNXbox Live
  Top
 

 
Deji  
Posted: Tuesday, Jul 31 2012, 18:17
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



QUOTE (dennis48309 @ Tuesday, Jul 31 2012, 18:14)
I understand that I can make MissionBegin loop. That still does not help the part for checking if the player is busted or wasted. I really don't think you understand that the waste_or_busted check needs to be inside of a loop. It can't be checked only once, and it surely can't be checked after theMissionBegin finally ends.

Better show some respect, kid. And FYI, the game automatically returns all subroutines when the player is wasted or busted, so your opinion is wrong.
Users WebsitePM
  Top
 

 
dennis48309  
Posted: Tuesday, Jul 31 2012, 18:19
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 30, 2012

XXXXX



CODE
while true
   0001: wait 0 ms
   // Put mission checks HERE
end
0051: return


If the wasted_or_busted check is outside of that loop then how will the mission thread end if you get busted or wasted? I really appreciate your help. Thanks.
PM
  Top
 

 
SilentPL  
Posted: Tuesday, Jul 31 2012, 18:21
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




You trying to say that Rockstar Games was wrong then? Every-f*cking-mission in every-f*cking-III-era game used that structure (~250 missions working for unknown reason? Don't think so). Better test it by yourself, insead of trying to prove we don't know what SCM is.
Users WebsitePMMSNXbox Live
  Top
 

 
dennis48309  
Posted: Tuesday, Jul 31 2012, 18:21
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 30, 2012

XXXXX



Deji, mind your own f*cking business you slanted eye f*ck. Ching chong chang bitch!


User was warned for this post
PM
  Top
 

 
Deji  
Posted: Tuesday, Jul 31 2012, 18:26
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



I'm English actually, but unlike you I'm accepting of any race/culture.. except them punk-ass Ballas... The member title obviously got you confused, but wouldn't the Jamaican flag raise some questions? Or don't you even know it from the flag of France?
Users WebsitePM
  Top
 

 

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG