BigHomie Posted May 20, 2017 Share Posted May 20, 2017 Hello everybody, I'd like my code to only execute after Sweet's mission "Cleaning the Hood" is passed. Any help is appreciated. With best regards, Big Homie Link to comment Share on other sites More sharing options...
Jack Posted May 20, 2017 Share Posted May 20, 2017 Taken from the main.scm: :SWEET1B_15979$Sweet_Total_Passed_Missions += 10318: set_latest_mission_passed 'SWEET1B' // Cleaning the Hood01E3: show_text_1number_styled GXT 'M_PASSR' number 3 time 5000 style 1 // MISSION PASSED!~n~~w~RESPECT +0998: add_respect 3076C: set_zone 'GAN1' gang 1 density_to 40076C: set_zone 'GAN2' gang 1 density_to 40Player.ClearWantedLevel($PLAYER_CHAR)0394: play_music 1030C: progress_made = 1return 0318: set_latest_mission_passed 'SWEET1B' // Cleaning the Hood So we need conditional check for that opcode:{$CLEO}0000:REPEAT wait 250UNTIL 0256: player $PLAYER_CHAR definedWHILE TRUE wait 0 0A8D: [email protected] = read_memory 0x5D1B81 size 4 virtual_protect 0 // pointer to a latest mission passed 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 [email protected] += 4 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 0AD3: [email protected] = format "%s" [email protected] IF 05AE: [email protected] == 'SWEET1B' // Cleaning the Hood THEN // Cleaning the Hood mission completed ENDEND Wanted Level Editor Gore Level Effect [III] My YouTube Channel Link to comment Share on other sites More sharing options...
BigHomie Posted May 20, 2017 Author Share Posted May 20, 2017 Shi**, I'd thought it was as simple as to just check if the variable is greater than or equal to a certain value. Well, thanks anyway, gonna give it a try tomorrow. Link to comment Share on other sites More sharing options...
OrionSR Posted May 21, 2017 Share Posted May 21, 2017 I found what looks like a good reference for the mission progress variables of San Andreas. Cleaning the Hood is $Sweet_Total_Passed_Missions == 2, but >1 might be more appropriate, depending on your purpose. https://kb.speeddemosarchive.com/Grand_Theft_Auto:_San_Andreas/Missions/Chains Link to comment Share on other sites More sharing options...
BigHomie Posted May 21, 2017 Author Share Posted May 21, 2017 So if I wanted the code to execute always, also after passing more of Sweets's missions it would be more appropriate to make it >1? How would it look in a code that checks the variable to be greater than 1? Link to comment Share on other sites More sharing options...
deltaCJ Posted May 22, 2017 Share Posted May 22, 2017 (edited) There is no need to make an ASI, or advanced code for this... Dutchy made a nice tutorial on her "Mission Scripting for Dummies" page It's called a sniffer thread... Lemme explain: you make your mission :MIS1_startmission content hereplease don't actually copy thisthis is just demonstration.:MIS1_ENDyou take the variable that will activate the mission$MISSION_TRIGGER += 1return(DONT f*ckING COPY THIS) Okay, done mission adds 1 to variable, good now hopefully you have :INTL mission like in original SA where it sets a whole bunch of variables (usually mission 0 and mission 1) Go to your main thread, and add on: start_mission 0 //define the mission first:INTLwait 0$MISSION_TRIGGER = 0 now for the sniffer thread: in the main make a thread called whatever (is going to be called sniffer in this case) we will check if the variable meets the requirements and if the player is in the sphere we want him to be in :SNIFFERwait 0ifplayer.defined($PLAYER_CHAR)jf @SNIFFERif$ONMISSION == 0jf @SNIFFERif//player in sphere opcode herejf @SNIFFERif$MISSION_TRIGGER == 0jf @SNIFFER_MISSION2$ONMISSION = 1start_mission (NUMBER HERE)jump @SNIFFER_MISSION2:SNIFFER_MISSION2if$MISSION_TRIGGER == 1jf @NEXT_SNIFFERTHREAD$ONMISSION = 1start_mission (NUMBER_HERE)jump @NEXT_SNIFFERTHREADEDIT: Forgot to put in $ONMISSION = 1 when the trigger equals somethingI think you can do that when you go into the mission but just to be sure...(This you can copy and replace all the labels and variables and sh*tmake sure to replace the variables with the ones you made in the INTL your game will crashif you don't.) And that's it. Also you only have to do the start_mission thing once if its only going to happen one time. And if you want I can tell you how you can destroy the marker after your mission is done. Edited May 22, 2017 by deltaCJ Link to comment Share on other sites More sharing options...
BigHomie Posted May 22, 2017 Author Share Posted May 22, 2017 I didn't mean to write a new mission, I just want the crack den you take out to be available for purchase. So all I need is to check if the player has gotten past "Cleaning the Hood" Link to comment Share on other sites More sharing options...
BigHomie Posted May 22, 2017 Author Share Posted May 22, 2017 So I thought this code would create an available asset pickup in front of the Crack Den after Cleaning the Hood. {$CLEO .cs}03A4: name_thread "Script":L1if0256: player $PLAYER_CHAR defined004D: jump_if_false @L1:L2 if and $Sweet_Total_Passed_Missions>1$ONMISSION==00518: [email protected] = create_available_asset_pickup 'PROP_3' at 2169.5193 -1674.5095 15.0859 price $501620A93: end_custom_thread Well, I was wrong, nothing happend after finishing the mission. What would I have to do to make the asset pickup to appear. Link to comment Share on other sites More sharing options...
deltaCJ Posted May 22, 2017 Share Posted May 22, 2017 It is better to make it in the main.scm and you would do it just like the sniffer (The Buying Properties thing is a mission too ya know,) Link to comment Share on other sites More sharing options...
BigHomie Posted May 22, 2017 Author Share Posted May 22, 2017 So is there no way to make an asset in a Cleo Script? I remember it being featured in some Cleo mods that didn't touch main Link to comment Share on other sites More sharing options...
BigHomie Posted May 22, 2017 Author Share Posted May 22, 2017 Ps: is it possible to bind an asset pickup's availabilty to a certain condition (e.g passing Cleaning the Hood?) Link to comment Share on other sites More sharing options...
madleg Posted May 22, 2017 Share Posted May 22, 2017 {$CLEO .cs}0000:const PlayerMoney = player.Money($PLAYER_CHAR) den_pickup = [email protected] true wait 1000 if $SWEET_TOTAL_PASSED_MISSIONS > 1 then 0A95: enable_thread_saving 0518: den_pickup = create_available_asset_pickup 'PROP_3' at 2169.5193 -1674.5095 15.0859 price 50 break endendwhile true wait 500 if 0214: pickup den_pickup picked_up then PlayerMoney += 50 break endend0A93: end_custom_thread Link to comment Share on other sites More sharing options...
BigHomie Posted May 22, 2017 Author Share Posted May 22, 2017 Sorry for being an absolute noob, but could you elaborate the code a vit further? Link to comment Share on other sites More sharing options...
BigHomie Posted May 22, 2017 Author Share Posted May 22, 2017 So I understand it for the most part, but what purpose does the part adding to the player's money serve? Link to comment Share on other sites More sharing options...