BigHomie Posted July 31, 2017 Share Posted July 31, 2017 Hello, I recently started messing with cleo in VC. I started writing a simple script on the verge to being mid difficulty, but was stunned by a compiler error telling me the max variable is [email protected] 18 variables seem a bit too little, so I need to know if there is some way to extend the max space. I'd appreciate any help. With best regards, BigHomie Link to comment Share on other sites More sharing options...
kosticn101 Posted July 31, 2017 Share Posted July 31, 2017 (edited) Me again with my "I don't have VC" story.Do you really need all 18 variables taken at the same time? Why don't you reuse them?Split your code into logical parts and use scm_func a lot.One method that is used for SA and apparently VC is thread memory.I wrote a code that demonstrates usage of thread memory in SA. {$CLEO}0000:wait 200000A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]: call_scm_func @write_to_mem 2 VARNUMBER 18 VALUE [email protected]: call_scm_func @write_to_mem 2 VARNUMBER 19 VALUE [email protected]: call_scm_func @write_to_mem 2 VARNUMBER 20 VALUE [email protected]: call_scm_func @read_from_mem 1 VARNUMBER 18 STORE_TO [email protected]: show_formatted_text_highpriority "%.2f" time 1000 [email protected] //not supported in VC, just for demowait 10000AB1: call_scm_func @read_from_mem 1 VARNUMBER 19 STORE_TO [email protected]: show_formatted_text_highpriority "%.2f" time 1000 [email protected] 10000AB1: call_scm_func @read_from_mem 1 VARNUMBER 20 STORE_TO [email protected]: show_formatted_text_highpriority "%.2f" time 1000 [email protected] 10000A93: end_custom_thread //copy and paste these functions:write_to_mem0AB1: call_scm_func @get_location 1 VARNUMBER [email protected] LOCATION [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00AB2: ret 0:read_from_mem0AB1: call_scm_func @get_location 1 VARNUMBER [email protected] LOCATION [email protected]: [email protected] = read_memory [email protected] size 4 virtual_protect 00AB2: ret 1 [email protected]:[email protected] -= [email protected] *= 40AC6: [email protected] = label @threadMemory offset005A: [email protected] += [email protected] // (int)0AB2: ret 1 [email protected] :threadMemoryhex00 00 00 00 //[email protected] 00 00 00 //[email protected] 00 00 00 //[email protected] Zombie Mod for VC by krvger written using these functions.Vice City: + call_scm_func = 05F5 + ret = 05F6 + label offset = 05F7https://www.gtagmodding.com/forums/index.php?showtopic=346https://sannybuilder.com/forums/viewtopic.php?pid=12041 Edited August 12, 2017 by kosticn101 Link to comment Share on other sites More sharing options...
BigHomie Posted July 31, 2017 Author Share Posted July 31, 2017 Well, I want to spawn 11 actors around the map and have an icon for each one. Removing references to any actor wouldn't work so great because I want to check if they are defined. I can't assign a variable to every icon though, could I in some way bind them to the actor? Maybe through arrays? Link to comment Share on other sites More sharing options...
kosticn101 Posted July 31, 2017 Share Posted July 31, 2017 (edited) Ufff, tricky... You know that you don't get new varnumbers if you use arrays? If array starts at [email protected] and you have three elements in it, [email protected] [email protected] [email protected] are reserved. So, have you tried with thread memory? In my example I used only 3 "additional" vars, you can add more. Code should be identical (opcodes are different). Create a test script, just to get a feeling for this. Try to port my script to VC (instead of displaying coordinates on the screen, create marker there or whatever else). Edited August 2, 2017 by kosticn101 Link to comment Share on other sites More sharing options...
deltaCJ Posted August 1, 2017 Share Posted August 1, 2017 Its good to define them but define them and then remove references and such. Link to comment Share on other sites More sharing options...
kosticn101 Posted August 1, 2017 Share Posted August 1, 2017 (edited) Did thread memory worked for you?Vice City: + call_scm_func = 05F5 + ret = 05F6 + label offset = 05F7 Edited August 2, 2017 by kosticn101 Link to comment Share on other sites More sharing options...
BigHomie Posted August 1, 2017 Author Share Posted August 1, 2017 I haven't tried, though I will tomorrow. I'll also try Deji's Array Method using globar vars, I think it worked nearly perfect 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