Jump to content

Creating a Property Icon With Money Asset


KC702

Recommended Posts

Hello, I was looking to add an asset money pickup to Red Dragon Casino.

 

My search on the forums pointed me to a template for creating such a thing - which turns out to be for a mod I already have running/working in my game.

The template is here:

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

//-------------MAIN---------------
0000: NOP 
jump @Noname_9 

:Noname_9
wait 0 
0A95: enable_thread_saving 
0518: 11@ = create_available_asset_pickup 'PROP_3' at 2322.966 -1646.255 14.827 price 15000  // Press ~k~~PED_ANSWER_PHONE~ to buy this property.

:Noname_47
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
else_jump @Noname_47 
if 
  $ONMISSION == 0 
else_jump @Noname_47 
if 
   Pickup.Picked_up(11@)
else_jump @Noname_47 
00BA: show_text_styled GXT 'BUYPRO' time 5000 style 2  // Property purchased!
0394: play_music 1 
04A6: 0@ = create_asset_money_pickup_at 2322.966 -1646.255 14.827 money 6000 6000 
0A10: increase_integer_stat 15 by 15000 
0A93: end_custom_thread 

 

There were a number of directives SB did not understand so I could not compile without making adjustments (taken from directives from main.scm):

- "jump" and "else_jump" switched to "goto_if_false"

- Player.Defined($PLAYER_CHAR) switched to is_player_playing $PLAYER_CHAR

- Pickup.Picked_up switched to has_pickup_been_collected

I changed the coordinates, price, integer stat.

I changed the @ from 11 to 12 since that seemed to be a common theme with this mod (they are numbered 1-11)

Additionally, in an effort to keep with the storyline - I added a mission requirement for the property to show up.

 

My script for Red Dragon Casino:

Spoiler
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 
goto_if_false @Noname_9 

:Noname_9
wait 0 
0A95: enable_thread_saving
If and
	$Casino_Total_Passed_Missions > 6
	$Heist_Total_Passed_Missions > 5
goto_if_false @Noname_9
    0518: 12@ = create_available_asset_pickup 'PROP_3' at 2020.500 990.375 10.25 price 100 // Press ~k~~PED_ANSWER_PHONE~ to buy this property.

:Noname_49
wait 0 
if 
   is_player_playing $PLAYER_CHAR
goto_if_false @Noname_49 
if 
  $ONMISSION == 0 
goto_if_false @Noname_49 
if 
   has_pickup_been_collected 12@
goto_if_false @Noname_49 
00BA: show_text_styled GXT 'BUYPRO' time 5000 style 2  // Asset Acquired!
0394: play_music 1 
04A6: 0@ = create_asset_money_pickup_at 2020.500 990.375 10.25 money 50000 50000 
0A10: increase_integer_stat 50 by 150000 
0A93: end_custom_thread 


TERMINATE_THIS_CUSTOM_SCRIPT

 

I was hoping someone could tell me why this script is crashing the game after the loadscreen.

I backtracked to just changing the coordinates on the template and it still crashes after the loadscreen.

Also, I was wondering how the template has directives that are unknown in SB but was compiled and works in game?

 

Any help would be greatly appreciated.

Edited by KC702
format
Link to comment
Share on other sites

13 hours ago, KC702 said:

There were a number of directives SB did not understand

I suspect the problem might be an inconsistency of SA mode vs SCR mode commands. I'd expect the class based commands like Player.Defined($PLAYER_CHAR) to only work in SA mode, so I'm assuming you are trying to compile with SCR mode.

 

These commands will need to have their parameter order swapped to work with SCR mode:

//0518: 12@ = create_available_asset_pickup 'PROP_3' at 2020.500 990.375 10.25 price 100
0518: create_forsale_property_pickup 2020.500 990.375 10.25 price 100 message 'PROP_3' handle 12@

//04A6: 0@ = create_asset_money_pickup_at 2020.500 990.375 10.25 money 50000 50000 
04A6: create_protection_pickup 2020.500 990.375 10.25 revenueLimit 50000 revenueRate 50000 handle 0@


Also, property budget stat is wrong, and value should match the price of the property:

// 0A10: increase_integer_stat 50 by 150000 // Lightest Weight STAT050
0A10: increase_integer_stat 15 by 100 // Property Budget STAT015 

 

Edited by OrionSR
Link to comment
Share on other sites

23 hours ago, KC702 said:

Any help would be greatly appreciated.

i won't help you but i can say that picking up a property icon pickup and buying a house increases the total progress.. It's okey to use your script if you are not into %100 but i suggest you to pay attention. My claim needs to be clarified by testing.. 🙂

Link to comment
Share on other sites

17 hours ago, OrionSR said:

inconsistency of SA mode vs SCR mode commands

Thank you for this, I completely spaced that multiple functions were available for Sanny Builder. I switched it to SCR when I first downloaded the program and ran with it.

The code swaps above did mend the crashes - thank you for that.

Regarding the integer stat, I thought that was the rate the money would have accumulated (ie $50 every 15000miliseconds). I was way off base lol.

I still have a lot to learn, but I appreciate you taking the time post over my posts these last few weeks. 

 

7 hours ago, ArmanCan said:

property icon pickup and buying a house increases the total progress

I did monitor this as well, but did not see a jump in my game progress after the purchase? I remained 57.5%

 

(Finalized?) asset pickup for Red Dragon Casino (unlocked after LV missions - placed near the front entrance)

Spoiler
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 
goto_if_false @Noname_9 

:Noname_9
wait 0 
0A95: enable_thread_saving
If and
	$Casino_Total_Passed_Missions > 6
	$Heist_Total_Passed_Missions > 5
goto_if_false @Noname_9
    0518: create_forsale_property_pickup 2024.500 1005.375 10.25 price 1000 message 'PROP_3' handle 12@ // Press ~k~~PED_ANSWER_PHONE~ to buy this property.

:Noname_49
wait 0 
if 
   is_player_playing $PLAYER_CHAR
goto_if_false @Noname_49 
if 
  $ONMISSION == 0 
goto_if_false @Noname_49 
if 
   has_pickup_been_collected 12@
goto_if_false @Noname_49 
00BA: show_text_styled GXT 'BUYPRO' time 5000 style 2  // Asset Acquired!
0394: play_music 1 
04A6: create_protection_pickup 2024.500 1005.375 10.25 revenueLimit 50000 revenueRate 50000 handle 0@ 
0A10: increase_integer_stat 15 by 1000 // Property Budget STAT015  
0A93: end_custom_thread 


TERMINATE_THIS_CUSTOM_SCRIPT

 

 

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.