-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for campaign status #1639
Comments
Just thinking, isn't the UID (guess thats the campaign ID?) the folder name? Since they are unique, otherwise you'd overwrite an existing campaign. That'd also allows easy manual unlocking of missions (e.g. you don't want to play mission 3 of the roman campaign). I think we should allow campaign creators to unlock missions by Id (as you mentioned it I guess), since that'd allow branching stories, e.g. if you decide to defeat player 2 in mission 2, you unlock mission 4 instead of 3, while defeating player 3 would unlock mission 3. Alas this is currently not required and maybe is never, I still like having the option :) |
The API looks good. Question is only how to get the UID. I guess as you only need them from within a campaign it would be great to not having to specify it at all but make the C++ code calculate it, e.g. a hash of the path to the campaign description. But I'm not sure how'd we be able to get that from inside a running game or a savegame. So "missionId" = index of the mission in the campaign, and UID is what we need to determine somehow. If it needs to be passed by the LUA script, it can't be the folder name as a campaign might reside in different folders (for different users) and still be the same (e.g. "world" and "world-testing-for-dev"). So how would a lua script know about it? |
But does that really matter? Since they are two different campaigns at all, they should have different IDs as well or am I missing something? |
That is exactly my point. The lua script would call |
After starting a game we do not know anymore from which campaign we are coming. The same is true for a savegame. Therefore we need a UID to have the relation between the campaign and the currently played game. I think we have different options here.
How the UID is computed is another thing. We can for example take the path to the campaign folder and apply a sha1 hash to it and us it as UID as @Flamefire already mentioned. We can also choose an arbitrary UUID (https://de.wikipedia.org/wiki/Universally_Unique_Identifier) |
For the old World campaign we need the possibility to enable more then one mission. For example if Europa is conquered Africa,Grönland and North Asia is enabled. |
why not storing the campaign (the script / the folder, whatever) in the map info? we already have that as a struct now, so starting from a campaign the game could simply recognize the campaign and trigger something on loss/win? No weird uid, no complicated stuff, only the campaign info available. Then:
|
I see trouble keeping that available when continuing a savegame. We currently store the gamestate with the map and map script. Did you intend to add the campaign script to that and let that declare some kind of name the campaign screen then recognizes? And where would you store the unlocked/finished map states? That would need to be available in the campaign-mission screen which reloads the campaign script from scratch. |
we would need to have a campaign savegame - adding additional information to the savegame shouldnt be a problem, I thought we anyway have a custom format? storing the campaign name to it? |
isFinished(UID,missionId) setFinished(UID,missionId)
isPlayable(UID,missionId) setPlayable(UID,missionId)
The text was updated successfully, but these errors were encountered: