wowgetoffyourcellphone Posted December 24, 2023 Report Share Posted December 24, 2023 Hi y'all. For my latest iterations of the Cycladic Archipelago skirmish map in Delenda Est I've created a new treasure called, "The Argo", which is a shipwreck that gives a lot of Wood, Glory, and Coin loot. I'd like to make it show up randomly at 4 different points on the map or not at all. So, 20% chance at points A, B, C, and D, and 20% chance at no points. As I've modded a script (used on the gallic_fields_3p map in base game) for the Miletus Peninsula skirmish map to send pirate ships into your shipping lanes every X minutes, I hope this treasure placing idea is possible with scripting too. Anyone have any insights or want to help me with this? 2 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted December 24, 2023 Author Report Share Posted December 24, 2023 Trigger.prototype.SpawnUnits = function() { var intruders = TriggerHelper.SpawnUnitsFromTriggerPoints( pickRandom(["A", "B", "C", "D"]), "gaia/treasure/special_argo", this.Count, 1); } I'm guessing I'm missing something. Quote Link to comment Share on other sites More sharing options...
sternstaub Posted December 25, 2023 Report Share Posted December 25, 2023 If randomness is not allowed in the simulation (-> deterministic), i think it must be done in the lobby? Not sure, but Petra AI behaviour can be set to random aswell. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted December 25, 2023 Author Report Share Posted December 25, 2023 23 minutes ago, sternstaub said: If randomness is not allowed in the simulation (-> deterministic), i think it must be done in the lobby? Not sure, but Petra AI behaviour can be set to random aswell. "Random" is of course deterministic, not "truly" random, but to the end-player it appears random even if the sequence starts over after 78612 iterations. Hell, it'll appear random even if there are only 10 iterations. But back to the script, you can make objects appear at random locations by using the TriggerPoint objects in Atlas. It's already done on the Gallic Fields map. Just looking to make a script do something similar to that map, but just place an object 'Randomly' at one of 4 TriggerPoints. Quote Link to comment Share on other sites More sharing options...
alre Posted December 26, 2023 Report Share Posted December 26, 2023 I'd rather put 4 ships down in atlas and make 3 disappear than make one ship appear on a random spot that is not that easy to set in atlas. Quote Link to comment Share on other sites More sharing options...
alre Posted December 26, 2023 Report Share Posted December 26, 2023 (edited) as I side note, I truly loved how Imperivm editor worked, it was one of the very best. you could put down a lot of units, adjust them as will, and set them "unspawned", just to spawn them when scripted. from the editor you could also add units to groups, or give them names, both accessible from scripts. Edited December 26, 2023 by alre 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.