ffman1985 Posted January 4, 2023 Share Posted January 4, 2023 (edited) I would like to know if it is possible to execute some more complex instructions in the cheat script, eg. saving and loading state? (Like the following:) If peek($123abc)==$ab Save to kof97.sv0 Endif If peek($123abc)==$cd Load from kof97.sv0 Endif I would like to create a script that automatically make a save under certain circumstance, and automatically load the save under another circumstance. If it is possible, what is the syntax for saving and loading a state? Edited January 4, 2023 by ffman1985 Link to comment Share on other sites More sharing options...
Tux Posted January 4, 2023 Share Posted January 4, 2023 (edited) Well the functions do not exist yet, but it should be trivial to do, although it's a little hard to imagine how you could use that, but I'll leave that to you... you now have : set_save_slot number : where 0 <= number <= 9, to choose save slot, like key F3 save_state : like key F2 load_state : like key F4 Edited January 4, 2023 by Tux Link to comment Share on other sites More sharing options...
ffman1985 Posted January 4, 2023 Author Share Posted January 4, 2023 (edited) Hello, Tux. Thank you for adding the new function. With this new function, I have created script that change the gameplay to verus mode for the Real Bout Fatal Fury Special (rbffspec) using the save/load function in cheat script. (I will create more of it for other old fighting games). Here is my work, feel free to have a look: https://drive.google.com/file/d/1s1HEDh9s_ncRwOd0-Qx3eZkNSk_DjTz1/view?usp=share_link In the txt file, there is also a boss hack and a practice mode cheat. Press Start button can change character during battle and you Do Not need controller 2 to select character for player 2. All the 3 new cheat are on the top of the file. Again, thank you for your great effort in making that new fuction. Edited January 4, 2023 by ffman1985 Link to comment Share on other sites More sharing options...
ffman1985 Posted January 5, 2023 Author Share Posted January 5, 2023 Also, can I use any random number function (eg between 1 to 100 or 0 to 99) in the script? If yes, what is the syntax of it? I want this because I want to control the probability of the cases to happen, something like the following: if RND<50 poke $12345 $ab else poke $12345 $cd endif Link to comment Share on other sites More sharing options...
Tux Posted January 5, 2023 Share Posted January 5, 2023 Not really convinced here, when I use a cheat I want it to be either enabled or disabled, not 50% chance. Link to comment Share on other sites More sharing options...
ffman1985 Posted January 5, 2023 Author Share Posted January 5, 2023 I am not using that for cheating. I use the script to make a vs mode for some older fighting game. I want that 50/50 probabilities function, because i want to set that 50% chance playing the battle music of the 1p character and 50% chance playing that of 2p character. Link to comment Share on other sites More sharing options...
Tux Posted January 5, 2023 Share Posted January 5, 2023 oh well... ! I guess it can be done, not top priority, I'd like to find the problems with the cps2 driver 1st, but ok... ! Link to comment Share on other sites More sharing options...
Tux Posted January 5, 2023 Share Posted January 5, 2023 Well after some tries : the basic random function in C is not exactly random, it expects some random seed to be fed, so you can initialize the seed yourself, or call repeatedly the rand() function for a real random interval this time to get a chance to get some real random number... ... too complex for that. Luckily for you there is an alternative : openssl provides its version of a random number generator and random numbers are important for cryptography so it's serious this time. Since it's already used by curl, it's just a lib which was already here anyway. The result : a function rnd() which returns a random byte, that is, a number between 0 & 255. So you see, simple request, but not so easy solution... ! But anyway it's done... Link to comment Share on other sites More sharing options...
ffman1985 Posted January 5, 2023 Author Share Posted January 5, 2023 (edited) Hello, Tux, appreciate for making this new function for me and also the fixing of the CPS2 Save function. I am so sorry that I have requested so much in a short period of time. (No next time). With the three new functions for cheat scripts, it allows to do something extra and more complex. I hope I can make sth useful and share here in the future. Edited January 6, 2023 by ffman1985 Link to comment Share on other sites More sharing options...
ffman1985 Posted January 6, 2023 Author Share Posted January 6, 2023 Just use the new rnd() function on my vs mode cheat of rbffspec, it nows have equal chance of playing the bgm from p1 character and p2 character (unlike the old version which only play the bgm from p1 character since loading from a savestate.). Here is the updated file: https://drive.google.com/file/d/1Jl1Il-bQaibfx5Mf05y6eAXctszJh5CA/view?usp=share_link Again, thank you Tux for making those new functions for the cheat script. Link to comment Share on other sites More sharing options...
mer-curious Posted January 6, 2023 Share Posted January 6, 2023 Nice job, ffman1985! The lack of a practice mode in older fighting games is really a down side for newcomers and/or for players who want to try new combos. I guess they weren't added even in recent releases of the games such as the ones for the Switch, which is a shame. I tried here your cheat and it worked Ok for the "Practice Mode", but the "VS Mode" is returning the following error: And then I have to click Ok many times to continue. Some times it works, some times it gets stuck there prompting "Ok" and I never am taken back to the game. My NG BIOS is set to "Unibios 4.0" and the region is "Japan" and Console". Hopefully this can be fixed. Thank you anyway for sharing your work here. 👍 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now