Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Summer Special
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Dead Sargent

[SA]Trying to make a Gang Territories mod in SB.

Recommended Posts

Dead Sargent

Hello I am trying to make a simple mod that enables gang territories and allows Gang wars much earlier in the game. I plan on making gang territories continue through the entire game, not just halt at the end of Green Sabre. I'm only a few hours into this mod and I'm just testing my script, but my issue is that when I use opcode 090C, I can only run it 6 times. If I run it 7 times and then try to start a gang war, the game crashes. So I tried to just use setting zone gang densities, but certain zones are being updated unless the player is either on mission = 0 or if you start a new save.

// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 6.14.2013
{$CLEO .cs}

//-------------MAIN---------------
03A4: name_thread "SETZONES" 

:SETZONES_12
0001: wait 0 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SETZONES_12 

:SETZONES_95
0001: wait 0 ms 
00D6: if 
0038:   $CELLPHONE_CALL_ID == 19 
004D: jump_if_false @SETZONES_95 
08CA: reset_zones_info 

:SETZONES_119
0001: wait 0 ms 
00D6: if or
0038:   $CELLPHONE_CALL_ID == 19 
0038:   $INTRO_TOTAL_PASSED_MISSIONS == 1 
004D: jump_if_false @SETZONES_119 
0001: wait 7000 ms 
0879: enable_gang_wars 1 
076C: set_zone 'GAN1' gang 1 density_to 15 
076D: get_zone 'GAN1' gang 1 density_to [email protected] 
01E4: show_text_1number_lowpriority GXT 'GW_ENBL' number [email protected] time 5000 flag 1 
0002: jump @SETZONES_214 

:SETZONES_214
0001: wait 0 ms 
00D6: if and
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 0 
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere $X_SWEET_HOUSE $Y_SWEET_HOUSE $Z_SWEET_HOUSE radius 1.2 1.2 2.0 on_foot 
004D: jump_if_false @SETZONES_214 
0983: unknown_disable_gang_wars 1 
08AC: hide_gang_zones_on_map 0 
0879: enable_gang_wars 1 
0002: jump @SETZONES_286 

:SETZONES_286
0001: wait 0 ms 
00D6: if 
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 1 
004D: jump_if_false @SETZONES_286 
0001: wait 10000 ms 
03E5: show_text_box 'EASTLS1' 
0002: jump @SETZONES_331 

:SETZONES_331
0001: wait 1000 ms 
00D6: if and
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere $X_SWEET_HOUSE $Y_SWEET_HOUSE $Z_SWEET_HOUSE radius 1.2 1.2 2.0 on_foot 
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 1 
004D: jump_if_false @SETZONES_331 
0002: jump @SETZONES_417 
00D6: if 
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 1 
004D: jump_if_false @SETZONES_331 
0002: jump @SETZONES_417 

:SETZONES_417
0001: wait 0 ms 
08A3: update_respect_while_on_mission 1 
00BC: show_text_highpriority GXT 'GW_MARK' time 10000 flag 1 
076C: set_zone 'GAN2' gang 0 density_to 15 
076A: set_zone 'GAN2' dealer_density_to 30 

:SETZONES_469
0001: wait 0 ms 
00D6: if and
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 3 
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere $X_SWEET_HOUSE $Y_SWEET_HOUSE $Z_SWEET_HOUSE radius 1.2 1.2 2.0 on_foot 
004D: jump_if_false @SETZONES_469 
076C: set_zone 'LIND3' gang 0 density_to 5 
076C: set_zone 'LIND3' gang 1 density_to 20 
03E5: show_text_box 'EASTLS1' 
0002: jump @SETZONES_469 

:SETZONES_570
0001: wait 0 ms 
00D6: if 
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 4 
004D: jump_if_false @SETZONES_570 
0001: wait 16 ms 
076C: set_zone 'LIND3' gang 0 density_to 5 
076C: set_zone 'LIND3' gang 1 density_to 20 
03E5: show_text_box 'EASTLS1' 
0A95: enable_thread_saving 
0A93: end_custom_thread 

 For those wondering I am using both Silent's "ExGangWars"  mod and ScottishGaming's "Expanded Gang Wars" if anyone can help with this script to give me a better understanding of CLEO and Sanny Builder that would be amazing. Thank you for your time.

Share this post


Link to post
Share on other sites
ZAZ

 

I don't see any big mistake, just two things:

 

1. this last block will not be read

Spoiler
:SETZONES_570
0001: wait 0 ms 
00D6: if 
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 4 
004D: jump_if_false @SETZONES_570 
0001: wait 16 ms 
076C: set_zone 'LIND3' gang 0 density_to 5 
076C: set_zone 'LIND3' gang 1 density_to 20 
03E5: show_text_box 'EASTLS1' 
0A95: enable_thread_saving 
0A93: end_custom_thread 

 

but this isn't a problem

 

2. this will be the real last code block and there the codes will be repeated permanently while CJ is standing inside the spot

:SETZONES_469
0001: wait 0 ms 
00D6: if and
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 3 
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere $X_SWEET_HOUSE $Y_SWEET_HOUSE $Z_SWEET_HOUSE radius 1.2 1.2 2.0 on_foot 
004D: jump_if_false @SETZONES_469 
076C: set_zone 'LIND3' gang 0 density_to 5 
076C: set_zone 'LIND3' gang 1 density_to 20 
03E5: show_text_box 'EASTLS1' 
0002: jump @SETZONES_469

this is not really a problem but it's N00b coding

 

 

1 hour ago, Dead Sargent said:

For those wondering I am using both Silent's "ExGangWars"  mod and ScottishGaming's "Expanded Gang Wars" if anyone can help with this script to give me a better understanding of CLEO and Sanny Builder that would be amazing. Thank you for your time.

My advise:

Test the script on unmodded game installation (only cleo is installed, no other scripts)

If it works then, then the problem seems to be caused because of conflicts to the other gang mods

 

 

Also consider that global variables like $X_SWEET_HOUSE $Y_SWEET_HOUSE $Z_SWEET_HOUSE

are not safe for the use in cleo scripts

Manipulating the content of globals can corrupt the data pool.

Your script just reads the content of globals, this should not be a problem, but removing globals gives a better chance to make the script stable

I think, these

$X_SWEET_HOUSE $Y_SWEET_HOUSE $Z_SWEET_HOUSE

can be changed with the explicit coords or with local variables

 

 

 

 

 

 

 

 

 

 

 

 

Edited by ZAZ

Share this post


Link to post
Share on other sites
OrionSR
16 hours ago, Dead Sargent said:

I can only run it 6 times.

I'm a bit confused. How are you running this script 6 times? Do you mean, you save and reload the 7th time and it crashes? Or are you launching it multiple times with an another script? This script gets trapped in loops quite often, so I doubt it is ever ending.

 

I don't see any issue with how you are using global variables. You will need to use these flow control variables to accomplish your goal, you aren't modifying the variable values, and you are using them as originally intended. Keep in mind that avoiding the use of most global variables is a very basic lesson from Cleo 101; you can get into trouble very quickly if they are used improperly. 

 

However, I am concerned about which variables you are using and why. Some of these may not work as expected.

:SETZONES_95
0001: wait 0 ms 
00D6: if 
0038:   $CELLPHONE_CALL_ID == 19 
004D: jump_if_false @SETZONES_95 
08CA: reset_zones_info

This section will wait until Sweet's Gang Call comes in when exiting CJ's house after completing Big Smoke, and after the instructions to go see Ryder has been displayed. It looks like the call ID won't change until another call is registered, probably Hernandez warning CJ not to leave town, so this section will reset the zone info again when the script restarts after loading. You might want to add a check that the call has not finished.

00D6: if and 
0038:   $CELLPHONE_CALL_ID == 19
0038:   $1347 == 0  // Sweets_Gang_Call_Recieved

A major problem with this though, is that when the script restarts it will be trapped waiting for these conditions to be true and won't progress further. I suspect the overall flow of the script will work better if the script will jump_if_false to the next section instead of looping forever to the top of each segment. I suggest working the logic to flow from top to bottom before jumping back to the top to check for changes. The only mini-loops would be something like waiting for the player to be defined, or perhaps waiting until the Sweet's gang call is over after it has started.

Also, reset all gang zone info - you want to wipe out all the normal gang zones everywhere? I wouldn't be surprised if this caused issues with other mods expecting their changes to be in place.

00D6: if or
0038:   $CELLPHONE_CALL_ID == 19 
0038:   $INTRO_TOTAL_PASSED_MISSIONS == 1 

True until another call has been registered but not if the Ryder mission has been completed, and loop forever until the conditions are true. I'm not really sure how this is different than the previous conditions. What was your goal with this section?

00D6: if and
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 0 
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere $X_SWEET_HOUSE $Y_SWEET_HOUSE $Z_SWEET_HOUSE radius 1.2 1.2 2.0 on_foot 
004D: jump_if_false @SETZONES_214 

If a Sweet mission has been completed then the script can't progress to later sections. Also, there's no check to stop this section from executing the changes more than once. How to get your segments to execute only once is a consistent problem.

 

Suggestions: 

 

The current sascm.ini hasn't been updated with the discovered descriptions for "unknown" opcodes. This "SCR" change simply makes the code more understandable. I'm pretty sure this setting will not persist in the save - it works like the button cheat. So, how to enable and disable this setting as required?

//0983: unknown_disable_gang_wars 1 
0983: set_only_create_gang_members 1

This stat is usually adjusted by the House Party mission. You might want to execute this when gang wars are enabled.

0629: change_integer_stat 337 to 1 // toggles the "territories under control" stat

 

Anyway, lots of issues with logic flow, but this is a very promising script. Working with the flow control variables is tricky business; you've done quite well on that aspect. I really appreciate that you've put in the work on your own and have shown a good example script. It would help a lot, both for your understanding of what you're trying to code and anyone trying to help, if you add comments at the beginning of each section that describes the purpose. Something like,

//:SETZONES_95
:RESET_ZONE_INFO
// Initialize all gang zone info everywhere during Sweet's call to explain the gangs

 

Edited by OrionSR

Share this post


Link to post
Share on other sites
Dead Sargent

Thanks for the response! I have made some changes to my script that I am still testing out. I plan on adding way more down the line, but I will continue to work on this for now as a learning experience.

3 hours ago, OrionSR said:

I'm a bit confused. How are you running this script 6 times? Do you mean, you save and reload the 7th time and it crashes? Or are you launching it multiple times with an another script? This script gets trapped in loops quite often, so I doubt it is ever ending.

Sorry for not being clear enough, when I use opcode 090C 7 times in the one script, when you go to start an offensive gang war, the game will crash. I tested it with the modded and un-modded gang turfs. I haven't tested if a defensive gang war would crash but I assume it would. Here is an example. (This was also one of my first times using Sanny Builder so its a bit rough.)

// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 6.14.2013
{$CLEO .cs}

//-------------MAIN---------------
03A4: name_thread 'GANGEXP' 

:GANGEXP_11
0001: wait 0 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @GANGEXP_11 

:GANGEXP_31
0001: wait 0 ms 
076C: set_zone 'MAR1' gang 0 density_to 40 
076C: set_zone 'MAR2' gang 0 density_to 40 
076C: set_zone 'MAR3' gang 0 density_to 40 
076C: set_zone 'MKT1' gang 0 density_to 40 
076C: set_zone 'MKT2' gang 0 density_to 40 
076C: set_zone 'MKT3' gang 0 density_to 40 
076C: set_zone 'MKT4' gang 0 density_to 40 
076D: get_zone 'MAR1' gang 0 density_to [email protected] 
076D: get_zone 'MAR2' gang 0 density_to [email protected] 
076D: get_zone 'MAR3' gang 0 density_to [email protected] 
076D: get_zone 'MKT1' gang 0 density_to [email protected] 
076D: get_zone 'MKT2' gang 0 density_to [email protected] 
076D: get_zone 'MKT3' gang 0 density_to [email protected] 
076D: get_zone 'MKT4' gang 0 density_to [email protected] 
00D6: if or
0038:   [email protected] == [email protected] 
0038:   [email protected] == [email protected] 
004D: jump_if_false @GANGEXP_31 

:GANGEXP_279
0001: wait 0 ms 
00D6: if or
0038:   $SMOKE_TOTAL_PASSED_MISSIONS == 4 
0038:   $CRASH_LS_TOTAL_PASSED_MISSIONS == 2 
004D: jump_if_false @GANGEXP_279 
0001: wait 0 ms 
0879: enable_gang_wars 1 
090C: highlight_inactive_gang_zone "MAR1" as_available_for_gangwars 
090C: highlight_inactive_gang_zone "MAR2" as_available_for_gangwars 
090C: highlight_inactive_gang_zone "MAR3" as_available_for_gangwars 
03F0: enable_text_draw 1 
00BC: show_text_highpriority GXT 'GW_MAR1' time 15000 flag 1 
0A92: create_custom_thread "GANGTURF.S" 
03A4: name_thread "GANGTURF" 

:GANGTURF_12
0001: wait 0 ms 
00D6: if 
00E1:   player 0 pressed_key 14 
004D: jump_if_false @GANGTURF_12 
00BB: show_text_lowpriority GXT 'GW_MARK' time 15000 flag 1 
090C: highlight_inactive_gang_zone "MKT1" as_available_for_gangwars 
090C: highlight_inactive_gang_zone "MKT2" as_available_for_gangwars 
090C: highlight_inactive_gang_zone "MKT3" as_available_for_gangwars 
090C: highlight_inactive_gang_zone "MKT4" as_available_for_gangwars 
0A93: end_custom_thread 
0A95: enable_thread_saving 
0A93: end_custom_thread 

 

Share this post


Link to post
Share on other sites
OrionSR
1 hour ago, Dead Sargent said:

when I use opcode 090C 7 times in the one script, when you go to start an offensive gang war, the game will crash.

Ah, okay. You may have found the limit for this type of zone running at once. Gang wars are tricky as almost everything is hard coded where it's difficult to figure out what's going on. However, I suspect you can solve the problem with:

090D: highlight_all_inactive_gang_zones_as_available_for_gangwars

The purpose of these opcodes is a bit clearer using the SCR definitions.

  • 090C: set_specific_zone_to_trigger_gang_war "GLN1"
  • 090D: clear_specific_zones_to_trigger_gang_war

 

Share this post


Link to post
Share on other sites
Dead Sargent
1 hour ago, OrionSR said:

Ah, okay. You may have found the limit for this type of zone running at once. Gang wars are tricky as almost everything is hard coded where it's difficult to figure out what's going on. However, I suspect you can solve the problem with:

090D: highlight_all_inactive_gang_zones_as_available_for_gangwars

The purpose of these opcodes is a bit clearer using the SCR definitions.

  • 090C: set_specific_zone_to_trigger_gang_war "GLN1"
  • 090D: clear_specific_zones_to_trigger_gang_war

 

Thanks for letting me know that is the limit, I just thought it would be simpler to have all the zones densities be set by the main.scm or the modded scripts, and then just highlight different areas of the map one by one rather than doing what I'm doing now which is clear all zones and set each zones density to X number if I want that zone to be active at certain points of the game. I am not great at using Visual Studio so I wont touch the hard coded stuff until I am more suited for the tasks that can only be done via c++. I know one thing that I want to have eventually is making defensive turf attacks more common and more challenging than in the vanilla game. Thanks for the reply! I'll keep working on my script and if I hit a wall, i'll post about it here.

Share this post


Link to post
Share on other sites
OrionSR
2 hours ago, Dead Sargent said:

Thanks for letting me know that is the limit

Don't read too much into my comment about a limit to 090C. I have no information on this other than your observations. 

 

2 hours ago, Dead Sargent said:

making defensive turf attacks more common and more challenging

Buried somewhere in this topic are my old notes on, among other things, how to increase the attacking gang strength (WarFerocity) by one more level and trigger a gang attack on demand.

 

BTW, if you are interested in a related side-project. The investigation linked above (spring 2011) spawned an idea to create a gang hud, an idea that I've reconsidered as recently as early this summer. The gang hud (an alternate layer to a coords hud) would display the hidden details for gang wars; gang densities, next attack time, time to return to attack zone, distance to zone under attack, attacking gang, control percentage, um... 3rd kill progress toward starting a war, maybe - not sure how. The gang hud was intended as a diagnostic tool for myself, something you might want to use as you progress with your project, but I think it might be quite useful as a general-player mod too. 

 

Some of advantages to this distraction, besides having the tool to help with your primary project, would be experience working with; game memory, advanced Sanny features like high-level constructs and constants that make scripts much easier to write and debug, and updated cleo codes and strategies like dynamic GXT and custom SCM functions. If you are at all familiar with C then you will love the high-level constructs - while, for, if-then-else, etc. Unfortunately, there are few examples to learn from available.  (FYI: The recently updated Sanny versions include some high-level example scripts written by ZAZ.) 

 

I've got a core coords hud to build from, but it was designed as a purely SCM script that would test custom GXT on PS2. It'll take a little work to revert to a simpler cleo version. 

 

Share this post


Link to post
Share on other sites
Dead Sargent

I have been working the script all day. Got a lot done, but still a ton of work ahead of me, but right now its turning out alright for my first extensive modding project. Here it is currently.

// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 6.14.2013
{$CLEO .cs}

//-------------MAIN---------------
03A4: name_thread "SETZONES" 

:SETZONES
0001: wait 0 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @SETZONES


//--------------------Set coords-------------------
0A92: create_custom_thread "SetCoords.cs"

:SETCOORDS
const
RyderX = 2459.427
RyderY = -1688.194
RyderZ = 13.5346


SweetX = 2515.452
SweetY = -1674.47
SweetZ = 13.8032

SmokeX = 2071.7429
SmokeY = -1703.7454 
SmokeZ = 13.5547
end
jump @SETZONES_5
0A93: end_custom_thread

//--------------------Mission Check---------------------
0A92: create_custom_thread "Mission.cs"

:Mission //Check if player has started either OG loc or Drive-by
wait 100 ms
if and
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere SmokeX SmokeY SmokeZ radius 1.5 1.5 2.5 on_foot //Smoke's house
0038:   $SMOKE_TOTAL_PASSED_MISSIONS == 0
0038:   $ONMISSION = 0
jf @SETZONES_60
jump @SETZONES_67

:Mission_1 //Check if player has started either Drive-by or OG Loc
wait 100 ms
if and
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere SweetX SweetY SweetZ radius 1.0 1.0 2.0 on_foot
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 4
0038:   $ONMISSION = 1
jf @SETZONES_65
jump @SETZONES_62 

0A93: end_custom_thread
//--------------------Gang Fued call----------------
:SETZONES_5
0001: wait 0 ms 
00D6: if and 
0038:   $1347 == 1
0038:   $INTRO_TOTAL_PASSED_MISSIONS == 2 //Check if Call has BEEN finished
004D: jump_if_false @SETZONES_1
jump @SETZONES_4


:SETZONES_1 //Check to see if the Sweet gang fued call has been answered
0001: wait 0 ms 
00D6: if and
0038:   $CELLPHONE_CALL_ID == 19 
0038:   $CALL_ANSWERED == 1
004D: jump_if_false @SETZONES_5
jump @SETZONES_3

:SETZONES_3
wait 0 ms
if
0038:   $1347 == 1 //Check if call has finished
jf @SETZONES_3
jump @SETZONES_6 
 
:SETZONES_4 //set grove zone without deleting pre existing zones
wait 0 ms 
0001: wait 70 ms 
076C: set_zone 'GAN1' gang 1 density_to 15 
076D: get_zone 'GAN1' gang 1 density_to [email protected] 
0879: enable_gang_wars 0 
0879: enable_gang_wars 1 
01E4: show_text_1number_lowpriority GXT 'GW_ENBL' number [email protected] time 5000 flag 1 //debug
0002: jump @SETZONES_154

:SETZONES_6 //Sets grove zones and clears all zones(start of game)
wait 0 ms 
08CA: reset_zones_info //Set grove density in grove to 15 
0001: wait 70 ms 
076C: set_zone 'GAN1' gang 1 density_to 15 
076D: get_zone 'GAN1' gang 1 density_to [email protected] 
0879: enable_gang_wars 0 
0879: enable_gang_wars 1 
01E4: show_text_1number_lowpriority GXT 'GW_ENBL' number [email protected] time 5000 flag 1 //debug 
0002: jump @SETZONES_154


//-----------------------Ryder------------------------------ 

:SETZONES_154    //Check if mission Ryder has been completed 
0001: wait 16 ms 
00D6: if 
0038:   $INTRO_TOTAL_PASSED_MISSIONS == 2 
004D: jump_if_false @SETZONES_183
//If Ryder has been passed, check if any zones have been interacted with by the player, so the script doesn't overwrite the zones everytime the save is reloaded
076D: get_zone 'IWD2' gang 1 density_to [email protected]
076D: get_zone 'IWD4' gang 1 density_to [email protected]
076D: get_zone 'IWD5' gang 1 density_to [email protected]
if or 
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
jf @SETZONES_309 //If Ryder has been passed and no zones were interacted with, run the command to set those zones, as if you had just passed Rdyer
wait 16 ms  
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0002: jump @SETZONES_446 

:SETZONES_183 //Check if mission Ryder has been started
0001: wait 0 ms 
00D6: if and
0038:   $INTRO_TOTAL_PASSED_MISSIONS == 1 
00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere RyderX RyderY RyderZ radius 1.2 1.2 2.0 on_foot 
0038:   $ONMISSION == 1 
004D: jump_if_false @SETZONES_154 
0002: jump @SETZONES_256 

:SETZONES_256 //Wait for Ryder cutscene to start
0001: wait 0 ms 
00D6: if 
016B:   fading 
004D: jump_if_false @SETZONES_284 
0001: wait 0 ms 
0002: jump @SETZONES_256 

:SETZONES_284 //Wait for Ryder cutscene to end or be skipped
0001: wait 16 ms 
00D6: if 
02E9:   cutscene_reached_end
004D: jump_if_false @SETZONES_284 
0002: jump @SETZONES_308 

:SETZONES_308 // Set Idlewood zones for Ballas at the start of Ryder
0001: wait 200 ms
076C: set_zone 'IWD1' gang 0 density_to 0 
076C: set_zone 'IWD3A' gang 0 density_to 0 
076C: set_zone 'IWD3B' gang 0 density_to 0 
076C: set_zone 'IWD2' gang 0 density_to 5 
076C: set_zone 'IWD4' gang 0 density_to 10 
076C: set_zone 'IWD5' gang 0 density_to 5 
0879: enable_gang_wars 0 
0879: enable_gang_wars 1
wait 16 ms
076D: get_zone 'IDW2' gang 0 density_to [email protected] 
01E4: show_text_1number_lowpriority GXT 'GW_TEST' number [email protected] time 5000 flag 1 //debug
jump @SETZONES_309

:SETZONES_309 //Set Idlewood zones for passing Ryder
wait 0 ms
if and
0038:   $ONMISSION = 0
0038:   $INTRO_TOTAL_PASSED_MISSIONS == 2
jf @SETZONES_309
wait 32 ms
076C: set_zone 'IWD1' gang 0 density_to 0 
076C: set_zone 'IWD2' gang 0 density_to 5
076C: set_zone 'IWD3A' gang 0 density_to 0 
076C: set_zone 'IWD3B' gang 0 density_to 0 
076C: set_zone 'IWD4' gang 0 density_to 15 
076C: set_zone 'IWD5' gang 0 density_to 5
jump @SETZONES_446
 

//-----------------Tagging up Turf-----------------

:SETZONES_446 //Check if player has passed Tagging up Turf
0001: wait 0 ms 
00D6: if 
0018:   $SWEET_TOTAL_PASSED_MISSIONS > 0 
004D: jump_if_false @SETZONES_475
//Zone check
076D: get_zone 'ELS3A' gang 1 density_to [email protected]
076D: get_zone 'ELS3B' gang 1 density_to [email protected]
076D: get_zone 'ELS3C' gang 1 density_to [email protected]
076D: get_zone 'ELS4' gang 1 density_to [email protected]
076D: get_zone 'JEF3B' gang 1 density_to [email protected]
076D: get_zone 'JEF3C' gang 1 density_to [email protected]
if or
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
jf @SETZONES_548
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
jump @SETZONES_30

:SETZONES_475 //Check if player has started tagging up Turf
0001: wait 0 ms 
00D6: if and
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 0 
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere SweetX SweetY SweetZ radius 1.2 1.2 2.0 on_foot 
0038:   $ONMISSION == 1 
004D: jump_if_false @SETZONES_446 
0002: jump @SETZONES_548 

:SETZONES_548 // Set zones in East LS for Ballas
0001: wait 125 ms 
076C: set_zone 'ELS1A' gang 0 density_to 0 
076C: set_zone 'ELS1B' gang 0 density_to 0 
076C: set_zone 'ELS2' gang 0 density_to 0 
076C: set_zone 'ELS3A' gang 0 density_to 10
076C: set_zone 'ELS3C' gang 0 density_to 10
076C: set_zone 'JEF3C' gang 0 density_to 10
076C: set_zone 'JEF3B' gang 0 density_to 10 
076C: set_zone 'ELS3B' gang 0 density_to 10 
076C: set_zone 'ELS4' gang 0 density_to 10 
0879: enable_gang_wars 0 
0879: enable_gang_wars 1 
0629: change_integer_stat 337 to 1

:SETZONES_27 //When player has either passed Tagging up turf or entered Jefferson/EastLS, display custom GXT.
wait 16 ms
if or
Player.InZone($PLAYER_CHAR,'JEF3C')
player.InZone($PLAYER_CHAR,'JEF3B')
player.InZone($PLAYER_CHAR,'ELS3A')
player.InZone($PLAYER_CHAR,'ELS3B')
player.InZone($PLAYER_CHAR,'ELS4')
$SWEET_TOTAL_PASSED_MISSIONS >= 1
then
wait 250 ms 
03E5: show_text_box 'EASTLS1' // ~w~The ~p~Ballas ~w~are marked in ~p~purple ~w~on the map, East Los Santos is their home turf!
else
jump @SETZONES_27
end 
0002: jump @SETZONES_30 

//---------------------Cleaning the hood-------------------------

:SETZONES_30 //Check if Cleaning the hood is passed
wait 0 ms
if
0018:   $SWEET_TOTAL_PASSED_MISSIONS > 1
jf @SETZONES_720
//Zone check
076D: get_zone 'GAN2' gang 1 density_to [email protected]
if
0019:   [email protected] > 0
jf @SETZONES_32
0006: [email protected] = 0
jump @SETZONES_40 


:SETZONES_720 //Check if player has started cleaing the hood
0001: wait 0 ms 
00D6: if and
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere SweetX SweetY SweetZ radius 1.2 1.2 2.0 on_foot //Sweets house 
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 1
0038:   $ONMISSION == 1
004D: jump_if_false @SETZONES_30
jump @SETZONES_31

:SETZONES_31 //Wait until cutscene has started
wait 16 ms
00d6: if 
016B:   fading
jf @SETZONES_35
jump @SETZONES_31 


:SETZONES_35 //Wait until cutscene has ended
wait 0 ms 
while 02E9: cutscene_reached_end //Currently not working
wait 16 ms
end
jump @SETZONES_32

:SETZONES_32 //Set density in Ganton 2 to Ballas 
0001: wait 0 ms 
08A3: update_respect_while_on_mission 1 
076C: set_zone 'GAN2' gang 0 density_to 15 
076A: set_zone 'GAN2' dealer_density_to 30 
076D: get_zone 'GAN2' gang 0 density_to [email protected]
0879: enable_gang_wars 0
0879: enable_gang_wars 1

:SETZONES_33
wait 0 ms
01E4: show_text_1number_lowpriority GXT 'GW_TEST' number [email protected] time 5000 flag 1 //DEBUG

//------------------------Nines and AK's----------------------------
:SETZONES_40 //Check if Nines and AK's is passed
wait 0 ms
if
0018:   $SWEET_TOTAL_PASSED_MISSIONS > 3
jf @SETZONES_41
//Zone check, but more complex because of condition limit
076D: get_zone 'IWD1' gang 1 density_to [email protected]
076D: get_zone 'IWD2' gang 1 density_to [email protected]
076D: get_zone 'IWD3A' gang 1 density_to [email protected]
076D: get_zone 'IWD3B' gang 1 density_to [email protected]
076D: get_zone 'IWD4' gang 1 density_to [email protected]
076D: get_zone 'IWD5' gang 1 density_to [email protected]
076D: get_zone 'LIND1A' gang 1 density_to [email protected]
076D: get_zone 'LIND1B' gang 1 density_to [email protected]
076D: get_zone 'LIND2A' gang 1 density_to [email protected]
076D: get_zone 'LIND2B' gang 1 density_to [email protected]
076D: get_zone 'LIND3' gang 1 density_to [email protected]
076D: get_zone 'ELS1A' gang 1 density_to [email protected]
076D: get_zone 'ELS1B' gang 1 density_to [email protected]
076D: get_zone 'ELS3A' gang 1 density_to [email protected]
076D: get_zone 'ELS3B' gang 1 density_to [email protected]
076D: get_zone 'ELS3C' gang 1 density_to [email protected]
076D: get_zone 'ELS4' gang 1 density_to [email protected]
if or 
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
jf @SETZONES_51
jump @SETZONES_60

:SETZONES_51
wait 0 ms
if or
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
jf @SETZONES_52

:SETZONES_52
wait 0 ms
if
0019:   [email protected] > 0
jf @SETZONES_50
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
jump @SETZONES_60

:SETZONES_41 //Check if player started Nines and Ak's
wait 0 ms
if and
0038:   $ONMISSION == 1
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 3
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere SweetX SweetY SweetZ radius 1.0 1.0 2.0 on_foot
jf @SETZONES_40
jump @SETZONES_42 

:SETZONES_42 //wait until cutscene starts
wait 0 ms
if
fading
jf @SETZONES_43
jump @SETZONES_42

:SETZONES_43 //Wait until cutscene is finished
wait 0 ms 
while 02E9: cutscene_reached_end //Currently not working
wait 16 ms
end
jump @SETZONES_868 

:SETZONES_868 //Start of Nines and AK's
wait 0 ms
if
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 3
jf @SETZONES_50 
0001: wait 0 ms 
076C: set_zone 'ELS1A' gang 0 density_to 15 
076C: set_zone 'ELS1B' gang 0 density_to 15 
076C: set_zone 'ELS2' gang 0 density_to 0 
076C: set_zone 'ELS3A' gang 0 density_to 30 
076C: set_zone 'ELS3B' gang 0 density_to 30
076C: set_zone 'ELS3C' gang 0 density_to 30 
076C: set_zone 'ELS4' gang 0 density_to 30 
076C: set_zone 'LIND1A' gang 0 density_to 15 
076C: set_zone 'LIND1B' gang 0 density_to 15 
076C: set_zone 'LIND2A' gang 0 density_to 15 
076C: set_zone 'LIND2B' gang 0 density_to 15 
076C: set_zone 'LIND3' gang 0 density_to 0
076C: set_zone 'LIND3' gang 1 density_to 10 
076C: set_zone 'IWD1' gang 0 density_to 30 
076C: set_zone 'IWD2' gang 0 density_to 30 
076C: set_zone 'IWD3A' gang 0 density_to 30 
076C: set_zone 'IWD3B' gang 0 density_to 30 
076C: set_zone 'IWD4' gang 0 density_to 30 
076C: set_zone 'IWD5' gang 0 density_to 30
0879: enable_gang_wars 0
0879: enable_gang_wars 1

:SETZONES_50 //End of Nines and AK's
Wait 0 ms
if
0018:   $SWEET_TOTAL_PASSED_MISSIONS > 3
jf @SETZONES_50
0001: wait 16 ms 
076C: set_zone 'ELS1A' gang 0 density_to 30 
076C: set_zone 'ELS1B' gang 0 density_to 30 
076C: set_zone 'ELS2' gang 0 density_to 0 
076C: set_zone 'ELS3A' gang 0 density_to 30 
076C: set_zone 'ELS3B' gang 0 density_to 30
076C: set_zone 'ELS3C' gang 0 density_to 30 
076C: set_zone 'ELS4' gang 0 density_to 30 
076C: set_zone 'LIND1A' gang 0 density_to 15 
076C: set_zone 'LIND1B' gang 0 density_to 15 
076C: set_zone 'LIND2A' gang 0 density_to 15 
076C: set_zone 'LIND2B' gang 0 density_to 15 
076C: set_zone 'LIND3' gang 0 density_to 0
076C: set_zone 'LIND3' gang 1 density_to 10 
076C: set_zone 'IWD1' gang 0 density_to 30 
076C: set_zone 'IWD2' gang 0 density_to 30 
076C: set_zone 'IWD3A' gang 0 density_to 30 
076C: set_zone 'IWD3B' gang 0 density_to 30 
076C: set_zone 'IWD4' gang 0 density_to 30 
076C: set_zone 'IWD5' gang 0 density_to 30
0879: enable_gang_wars 0
0879: enable_gang_wars 1

//------------------------Drive-By----------------------
:SETZONES_60 //Check if Drive-by is Passed
wait 100 ms
if
0018:   $SWEET_TOTAL_PASSED_MISSIONS > 4
jf @SETZONES_61
//Zone check
076D: get_zone 'JEF1A' gang 1 density_to [email protected]
076D: get_zone 'JEF1B' gang 1 density_to [email protected]
076D: get_zone 'JEF2' gang 1 density_to [email protected]
076D: get_zone 'JEF3A' gang 1 density_to [email protected]
076D: get_zone 'JEF3B' gang 1 density_to [email protected]
076D: get_zone 'JEF3C' gang 1 density_to [email protected]
if or
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
0019:   [email protected] > 0
jf @SETZONES_64
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
0006: [email protected] = 0
jump @SETZONES_66

:SETZONES_61 //Check if player has started Drive-by
wait 100 ms
if and
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere SweetX SweetY SweetZ radius 1.0 1.0 2.0 on_foot
0038:   $SWEET_TOTAL_PASSED_MISSIONS == 4
0038:   $ONMISSION = 1
jf @Mission
jump @SETZONES_62 

:SETZONES_62 //Wait Until cutscene starts
wait 64 ms
if
fading
jf @SETZONES_63
jump @SETZONES_62

:SETZONES_63 //Wait until cutscene is finished
wait 16 ms 
while 02E9: cutscene_reached_end //Currently not working
wait 16 ms
jump @SETZONES_63
end
jump @SETZONES_64 

:SETZONES_64 //Drive-By Zones
wait 0 ms
076D: get_zone 'JEF3C' gang 0 density_to [email protected]
01E4: show_text_1number_lowpriority GXT 'GW_TEST' number [email protected] time 5000 flag 1 //DEBUG
076C: set_zone 'JEF1A' gang 0 density_to 25
076C: set_zone 'JEF1B' gang 0 density_to 25
076C: set_zone 'JEF2' gang 0 density_to 25
076C: set_zone 'JEF3A' gang 0 density_to 25
076C: set_zone 'JEF3B' gang 0 density_to 30
076C: set_zone 'JEF3C' gang 0 density_to 30
0879: enable_gang_wars 0
0879: enable_gang_wars 1


//------------------------OG loc----------------------------CRASHING
:SETZONES_66 //Check if OG loc has been passed
wait 0 ms
if
0018:   $SMOKE_TOTAL_PASSED_MISSIONS > 0
jf @SETZONES_65
//Insert Zone check
//Insert Zone check
//Insert Zone check
//Insert Zone check
jump @SETZONES_69

:SETZONES_65 //Check if player has started OG-loc
wait 64 ms
if and
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere SmokeX SmokeY SmokeZ radius 1.5 1.5 2.5 on_foot //Smoke's house
0038:   $SMOKE_TOTAL_PASSED_MISSIONS == 0
0038:   $ONMISSION = 0
jf @Mission_1 
jump @SETZONES_67

:SETZONES_67 //Wait Until cutscene starts
wait 0 ms
if
fading
jf @SETZONES_68
jump @SETZONES_65

:SETZONES_68 //Wait until cutscene is finished
wait 0 ms 
while 02E9: cutscene_reached_end //Currently not working
wait 16 ms
end
jump @SETZONES_69

:SETZONES_69 //Start of OG Loc
wait 16 ms
0879: enable_gang_wars 0
0879: enable_gang_wars 1
076D: get_zone 'ELS2' gang 0 density_to [email protected] //Any pre existing ballas density is added to Vagos density
wait 0 ms
if 
0019:   [email protected] > 0
then
gosub @SETZONES_70
wait 16 ms
076C: set_zone 'ELS2' gang 0 density_to 0
076C: set_zone 'ELS2' gang 2 density_to [email protected]
else
076C: set_zone 'ELS2' gang 0 density_to 0
076C: set_zone 'ELS2' gang 2 density_to 25
end
:SETZONES_70
wait 0 ms
000A: [email protected] += 25
return





0A95: enable_thread_saving 
0A93: end_custom_thread

Lots of bugs to sort out in the next few days that I work on this. My plan is to set all of the zones for the first part of the game, Los Santos, then start working on manually creating custom gangs so if I ever make this public, people wont need to rely on 3-4 different mods just to use this one, and then hopefully learn how to change things related to memory like TimeUntilNextAttack and WarFerocity. But I'm pretty amazed at how far this script has come since I started it almost a week ago.

Share this post


Link to post
Share on other sites
ZAZ
22 minutes ago, Dead Sargent said:

I have been working the script all day. Got a lot done, but still a ton of work ahead of me, but right now its turning out alright for my first extensive modding project. Here it is currently.

0A92: create_custom_thread "SetCoords.cs"

:SETCOORDS

jump @SETZONES_5
0A93: end_custom_thread


0A92: create_custom_thread "Mission.cs"

:Mission //Check if player has started either OG loc or Drive-by 

jump @SETZONES_62 
0A93: end_custom_thread

Lots of bugs to sort out in the next few days that I work on this. My plan is to set all of the zones for the first part of the game, Los Santos, then start working on manually creating custom gangs so if I ever make this public, people wont need to rely on 3-4 different mods just to use this one, and then hopefully learn how to change things related to memory like TimeUntilNextAttack and WarFerocity. But I'm pretty amazed at how far this script has come since I started it almost a week ago.

 

Please explain, why do you have these entries in the script

0A92: create_custom_thread "SetCoords.cs"
0A92: create_custom_thread "Mission.cs"

and why do you have 0A93: end_custom_thread

 

here?

jump @SETZONES_5
0A93: end_custom_thread

and here?

jump @SETZONES_62

0A93: end_custom_thread

 

 

and this let your game crash

if
0019:   10@ > 0
then
gosub @SETZONES_70
wait 16 ms
076C: set_zone 'ELS2' gang 0 density_to 0
076C: set_zone 'ELS2' gang 2 density_to 10@
else
076C: set_zone 'ELS2' gang 0 density_to 0
076C: set_zone 'ELS2' gang 2 density_to 25
end
:SETZONES_70
wait 0 ms
000A: 10@ += 25
return

 

if [email protected] is not bigger than 0, then the gosub command will be skiped and return will be read


Note: gosub command leads to a "subscript" that must end with return
and only a "subscript" may end with return
otherwise the game crashs

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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