Need help making script have >128 local variables

Users who are viewing this thread

Lionheart2

Veteran
Hello everyone.

I have been working on a large mod these past few weeks, and I have run into a significant problem. After combining Diplomacy 4.2 with MOTO's Campaign AI fixes, I get more than 128 variables present in script_npc_decision_checklist_party_ai


If anyone could help fix this problem, or even just give advice, it would be greatly appreciated.

Also, what exactly is the problem with having more than 128 local variables? I haven't been able to figure that out.

Thanks!

P.S. I would have posted the code here but it won't let me exceed 40000 characters  :sad:
 
Help you fix it? Well, have you tried using less variables? :razz:

I mean it. I took a quick look at the code and there's a lot of variables which are used only once. You could easily replace them with one variable, which will re-used each time you need. Or you can use registers for that (+add a comment, so you won't get lost in the code).

You also have some variables which are actually pointless (get slot value to local -> check that local against other value or other local), and could be replaced by "slot_eq" or "slot_ge" operations.
 
Back
Top Bottom