Grondel wrote: ↑Tue Jan 10, 2023 1:08 pm
o_t_d_x wrote: ↑Tue Jan 10, 2023 12:35 pm
I am sure its easy and fast for one or few hexes.
But if you have hundreds of relative drop hexes, you will have hundreds of times to enter the map coordinates. With the old editor it was a klick. Very fast and always right, no errors. In that regard, the old editor is highly superior.
You will make errors and then you will have to check the coordinates again. Which means: even more work.
the way i scripted it is very easy to handle.
1. place the units somewhere u have place on the map
2. select all units, then copy paste unit IDs into LUA script
3. select target hexes, then copy paste hex coordinates into LUA script
the hard part was creating the script that puts the units on the target hexes and shuffles the hexes randomly evrytime.
sadly i have no acces to os.time in PC2-LUA so restarting the scenario will ceate the same positions. u need to go back to main menu and start or load a save from the previous map to get diff positions.
sers,
Thomas
3. How do you "select" the target hexes ? With mouse klicks ?
Reverse engineering the lua scripts sounds good, might return to modding and start with pc2. My own mod endsieg bases on the grand campaign AND it has many completly new maps. (attacking and capturing the french fleet in ... mers el kebir f. ex. ... i think was the name... because without french fleet ... how shall germany deal with the royal navy sucessfully in an alt. scen ? battle for odessa, battle for leningrad 42, murmansk etc....)
Regarding LUA: I just will use the scripts of the game and mods. Maybe i will buy myself a book for lua basics.
"sadly i have no acces to os.time in PC2-LUA so restarting the scenario will ceate the same positions. u need to go back to main menu and start or load a save from the previous map to get diff positions."
I dont see that as a problem, because newly positioned relative units for every new campaign playthrough is enough. Would be strange, that the relative units would change their positions with every reload. At least for me.
By the way: This relativ design approach shouldnt be only for unit dropping. I used it everywhere in the mod where it made sence: Scripts for exampel: A script that triggers everytime in the same round or when you enter the same hex is super boring. It works ONCE then its just exploiting for the player. Of course this relativ design approach has some "traps". Maps that have a super hard time limit arent possible that way. Because if the enemy attack might start 2 rounds later, you cannot force a hard time limit. If you force the player to use guards to defend small counter attacks at the end of the scenario, you have to give him the ressources to do so. So your giving nearly no prestige at all approach in your mod, might be a problem in that regard.
Everything thats relative improves replayability. I hate absolute triggers, positioning and scripts if they arent necessary.
At last allow me a personal question: This "sers" at the end does it stand for "servas" ? Are you an austrian like me ? Writing in german would be soooo much better.
When i ve got the pc2 modding basics, maybe we could combine our work to one big pc2 mod. Because i have many other ideas for the mod and most of them already done in pc one.