Page 1 of 2
Autoplacement of units on a map.
Posted: 26 Sep 2009, 21:40
by Tribulex
I was wondering if there is an existing algorithm for placing units over mex spots when the game loads. The units will belong to LuaGaia, and are control points. We will have a script that will automatically transfer ownership of one of these units to the team with the most value of units inside of it (value is just a custom param in the unit's lua script). When no units are in the radius (probably will just use the LOS) of the autoplaced unit's ownership will go back to luagaia.
Basically, the placement of these control points needs to be dictated in the map file somehow, and then loaded by the game. I thought mex spots would be a good way to do it so that our game is compatible with existing mex-spot based maps for spring. However, if there is a better way I would appreciate knowing it.
Thank you.
Re: Autoplacement of units on a map.
Posted: 26 Sep 2009, 21:46
by Neddie
Well, in 1944 and Star Wars: Imperial Winter, we have lua gadgets which place flags over either metal spots or in a custom layout when we generate a profile for a map. Feel free to look at the 1944 scripts.
Re: Autoplacement of units on a map.
Posted: 26 Sep 2009, 21:58
by Tribulex
Is there a repository for s44, or should I just extract the mod. What about SWIW?
Re: Autoplacement of units on a map.
Posted: 26 Sep 2009, 22:05
by Neddie
There is an SVN repository, but extracting the game is fine as well. Star Wars: Imperial Winter is in a closed beta, so you would have to ask one of the developers for help directly. You can find them in the #swiw channel on the Spring lobby.
SVN Folder Name: "S44LiteRelease.sdd"
1944 Repository:
https://spring1944.svn.sourceforge.net/ ... elease.sdd
Re: Autoplacement of units on a map.
Posted: 26 Sep 2009, 22:07
by Tribulex
Thank you.
Re: Autoplacement of units on a map.
Posted: 27 Sep 2009, 01:35
by bobthedinosaur
what about an army placer? maybe like a 60 second timer to place an army before hand. for mods that don't have bases and building.
I think it would be cool in various mods. like gundam and s44
Re: Autoplacement of units on a map.
Posted: 27 Sep 2009, 01:44
by FLOZi
Note that the S44 code is not exactly well optimized.
Re: Autoplacement of units on a map.
Posted: 27 Sep 2009, 01:47
by bobthedinosaur
for that idea you mean?
Re: Autoplacement of units on a map.
Posted: 27 Sep 2009, 03:14
by Pressure Line
bob: CA deployment mode.
Re: Autoplacement of units on a map.
Posted: 27 Sep 2009, 04:05
by bobthedinosaur
really? i need to play ca more
Re: Autoplacement of units on a map.
Posted: 27 Sep 2009, 04:17
by FLOZi
bobthedinosaur wrote:for that idea you mean?
In general.
Also note that S44 has CA deployment mode.
Re: Autoplacement of units on a map.
Posted: 27 Sep 2009, 04:52
by Tribulex
bobthedinosaur wrote:what about an army placer? maybe like a 60 second timer to place an army before hand. for mods that don't have bases and building.
I think it would be cool in various mods. like gundam and s44
Thank you but this has nothing to do with our game.
Pressure Line wrote:bob: CA deployment mode.
Deployment mode has nothing to do with our game. Please, I appreciate these ideas, but the control points MUST be dictated by the map. Since they don't belong to players until they occupy them, the units that serve as control points cannot be placed by the players, since this does not make any sense. I appreciate feedback, but really its good to have feedback that corresponds to the topic please.
Thank you.
Re: Autoplacement of units on a map.
Posted: 27 Sep 2009, 05:03
by bobthedinosaur
Many mods do this: Cuberor, s44, IW. All of which spawn neutral units on metal spots before the game starts.
Also,
Thank you but this has nothing to do with our game.
what game is that if you don't mind me asking?
Re: Autoplacement of units on a map.
Posted: 27 Sep 2009, 05:07
by FLOZi
http://spring1944.svn.sourceforge.net/v ... iew=markup
There's the specific S44 gadget which spawns flags (and handles how they are captured). It's GPL v2 so feel free to use it, though as I said, its not the best written code.
Re: Autoplacement of units on a map.
Posted: 27 Sep 2009, 08:49
by Tribulex
Thank you very much Flozi. It looks very similar to my code. Somehow your code works and my doesnt, so its very useful to me.
bobthedinosaur wrote:what game is that if you don't mind me asking?
I will pm you.
Re: Autoplacement of units on a map.
Posted: 27 Sep 2009, 09:37
by Tribulex
I have another lua question now. Have any scripts been created where two transports share a loaded unit list? For example, i load my unit into one transport, and then I can unload it from another transport. Its for a sort of teleportation system.
Re: Autoplacement of units on a map.
Posted: 30 Sep 2009, 22:26
by imbaczek
kernel panic's network faction packets/ports/connections work kinda like that, but i don't know if KP tries to preserve packet hitpoints, etc.
Re: Autoplacement of units on a map.
Posted: 30 Sep 2009, 22:40
by lurker
d_b wrote:nothing to do with our game
...
nothing to do with our game
Yes, they were talking to each other, no need to say it twice. Your question had already been answered at that point, so there was no reason to complain.
Actual transports using load and unload, no. Is this the way you want to do teleportation, or just an idea you had that might make it easier? Because doing it with transport buttons is slightly more difficult than other methods.
Re: Autoplacement of units on a map.
Posted: 01 Oct 2009, 03:38
by Tribulex
Oh, well any way in which a unit is "loaded" by the structure, or rather disappears from the map, and then can be recreated next to a structure of the same type. Basically its underground tunnels. It would be good to be able to add to this at will. Now I am thinking the KP network is pretty much exactly what I need, so thanks for making my brain work.
I want units that are "underground" to heal while they are underground. i havent looked at KP's code yet, but does this happen?
Re: Autoplacement of units on a map.
Posted: 01 Oct 2009, 05:50
by lurker
KP wipes out the units to full health. Will tunnels take time to go along?