Lopess Posted September 16, 2020 Report Share Posted September 16, 2020 Hello everyone, I would like to ask for help, I am creating some maps in which the victory would depend on the capture and maintenance of the capture (10 min for example) of structures initially in Gaia's possession. On the map, for example, there can be 5 locations with each of these structures (for now called flags) whoever conquers at least 4 of these structures the countdown begins, to win you must remain with these conquered structures. The map does not allow the construction of new cc and each player will only have the initial one. Most of the idea is easy for me, but I have no idea how to create the part of the script that creates the winning condition (number of flags won, regressive time to win at the end). If someone is interested in creating this part or knowing a map that has done something similar that can inspire me is of great help. (google translate, sorry : p) Quote Link to comment Share on other sites More sharing options...
badosu Posted September 16, 2020 Report Share Posted September 16, 2020 (edited) Hmm.. I didn't experiment much with this but if possible I'd think this would be done on a triggers script. Check out: - https://github.com/0ad/0ad/blob/master/binaries/data/mods/public/maps/random/jebel_barkal_triggers.js - https://github.com/0ad/0ad/blob/b364a8cc7f41fe305e8b436651f1ee59afa3a1e1/binaries/data/mods/public/maps/scripts/TriggerHelper.js In particular the functions which return entities, check owner for an entity and the OnOwnerShipChange callback. Since gaia should not own structures by default (depending on map) it should be easier to just check all gaia's structures (player with id 0). There could be a better way, but you could check this every x seconds or set an array with all the conquerable entity ids or on ownershipchange hook check if all were taken by the same player. As I said, I'm not familiar with this so someone else might know more. Edited September 16, 2020 by badosu 1 Quote Link to comment Share on other sites More sharing options...
bb_ Posted September 16, 2020 Report Share Posted September 16, 2020 An even better example is the "survival of the fittest" map. You should indeed be listening to the onOwnershipChanged messages. First find some way to filter the 5 entities (probably give them some identity class) and onOwnershipChanged you should be able to do the required checks. Another option is to look at CaptureTheRelic.js victory condition and do the same trick there (you probably can reuse that code, just need to change a class) 1 Quote Link to comment Share on other sites More sharing options...
Lopess Posted September 17, 2020 Author Report Share Posted September 17, 2020 I'm trying to use the capture the relic and Wonder scripts, but in both cases, in addition to not working properly, I can't get the time option before starting the game. Does anyone know what activates this option? Quote Link to comment Share on other sites More sharing options...
badosu Posted September 17, 2020 Report Share Posted September 17, 2020 What do you mean by time option? If it's the relic holding time it's set on gamesetup. Quote Link to comment Share on other sites More sharing options...
Lopess Posted September 17, 2020 Author Report Share Posted September 17, 2020 6 hours ago, badosu said: What do you mean by time option? If it's the relic holding time it's set on gamesetup. This option I wanted to say, even with the same script it does not appear in the capture the flag version. I'm missing something here lol Quote Link to comment Share on other sites More sharing options...
Silier Posted September 17, 2020 Report Share Posted September 17, 2020 you need to mimic this file (create new file, copy content of this, rename relevant variables)https://code.wildfiregames.com/source/0ad/browse/ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Sliders/RelicDuration.js 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.