Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Macielos on September 08, 2011, 04:06:36 pm
-
Hello. I've got a problem with variables in my campaign. In one mission a message appeared that I have too many player-persistent variables (can't be more than 100). But I must have more than 100 because I have 40 missions, most of which use checkpoint system and store data of ships that appear in multiple missions, so variables are essential. How can I remove variables from previous missions after I use them or, alternatively, how can I have more than 100 variables in the campaign?
-
Good gravy.. what kind of data are you saving for each checkpoint?
-
Can someone give this guy a variable whore badge or something?
Is it possible for you to reuse variables for example when a ship is destroyed or no longer going to reoccur in the campaign? I presume you are saving subsystem status and stuff like that, if that is the case I understand from a post karajorma made a while back that in some situations it is possible to use prime number equations to store multiple data points so might be worth looking into.
-
Good gravy.. what kind of data are you saving for each checkpoint?
In most missions - percentage values of ship hulls. In a few missions also ships' main beams. And of course some 0-1 variables (0 - checkpoint not reached, 1 - checkpoint reached; 0 - goal failed, 1 - goal completed, etc.).
Can someone give this guy a variable whore badge or something?
Is it possible for you to reuse variables for example when a ship is destroyed or no longer going to reoccur in the campaign? I presume you are saving subsystem status and stuff like that, if that is the case I understand from a post karajorma made a while back that in some situations it is possible to use prime number equations to store multiple data points so might be worth looking into.
Well, I can use one variable for different ships in different missions and if there is no other choice, I'll do so. But I'd like to avoid it because all variables are named after ship names and renaming them would take a lot of time and work (there are about 180 variables in total).
-
Well, you should only need 1 variable for checkpoint reached per mission.
0 = no checkpoint
1 = first checkpoint
2 = second checkpoint
3 = third checkpoint
etc.
You should also consider things like this for goals.
(for 3 goals)
111 = all three goals incomplete
121 = second goal complete, first and third incomplete
123 = first goal incomplete, second complete, third failed
or something like that...
-
Bear in mind that you can probably use previous-event/goal-true for quite a few of those goal things too.
The prime number thing that headdie refers to might be overkill for this situation. But if you need it, it is explained here.
http://www.hard-light.net/forums/index.php?topic=49360.msg1001415#msg1001415
-
Good advice above, but also:
If you are making a campaign of that size and plan to release it... please PLEASE play through the whole thing in debug mode and fix the warnings!
I mean, it might be overwhelming to do, but at least be aware of the bugs so that a player can play through your campaign without crashing himself/herself.
Also check fred logic to make sure every mission is beatable, and accounts for everything the player can do.
Sorry for the derail, but these issues appear frequently when people appear out of the blue with big campaigns. Make sure everything runs smooth.
-
Bitwise variables might be useful here too, although they are touchy at the best of times.
-
Also note that nightly builds have 250 variable slots available.
-
Thanks for your advices. Of course I can make one 0-1-2 variable for 2 goals instead of two 0-1 variables, but I'm afraid it won't be enough, because that would give max. 20 variables less, and I'll still have about 160 variables. Many variables are used for storing hull percentage of fighters and I don't want to remove this system. I think I must use a nightly build for my campaign. Thank you anyway.
If you are making a campaign of that size and plan to release it... please PLEASE play through the whole thing in debug mode and fix the warnings!
I mean, it might be overwhelming to do, but at least be aware of the bugs so that a player can play through your campaign without crashing himself/herself.
Also check fred logic to make sure every mission is beatable, and accounts for everything the player can do.
Sorry for the derail, but these issues appear frequently when people appear out of the blue with big campaigns. Make sure everything runs smooth.
Don't worry. I played through each mission of Shadow Genesis at least 8-10 times so far, the first missions about 20 times, my brother and co-leader of the project as well and what's more, we have a few testers that will get entire campaign to play as soon as work is finished. So you'll get a product elaborated :).
-
If you really need to get that much ship-data saved between the missions, the script i made might be useful for you: http://www.hard-light.net/forums/index.php?topic=74716.0
It saves ship-data into a file and can load it into the game again without using variables and you only need to use Fred sexps to control it. If you are interested i can make a simpler version of the script without stuff you don't need and try to fix it if there are any problems.