Request: Units Assigned to Gaia, Mapping, Etc. (long)

Request: Units Assigned to Gaia, Mapping, Etc. (long)

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Request: Units Assigned to Gaia, Mapping, Etc. (long)

Post by Argh »

Very simply put, I want to put several features into my game, that I know are *possible*, but I need code to make them work, and I'm a little busy with other stuff this week, so I was hoping maybe somebody would maybe look into this.

Basically:

1. How do I create Unit, put it in the gameworld, and assign it to Gaia? I just need to know what code I'd need here- nothing complicated, frankly.

2. This is a bit more involved, but... I'd like to have Units that were assigned to Gaia and placed onto the gameworld based on the following parameters:

A. Slope. Can't put it on steep slopes.
B. Water. Can't put it on water.
C. Checks for other objects. Will not attempt to place on other objects.

3 Lastly, I'd like to be able to do all of the above, but with some sort of text-based grid system that expands dynamically based on map size, XZ. IOW, I'd like to be able to something where I said, "put this at 20% X, 10% Z, or whatever location nearest meets the requirements". This is a big thingie to ask for, I know, but it'd have multiple uses.


Ok... so, what can we use all of the above for, anyhow?

1. Games could be developed that did not feature mining- instead, we could place various objects that, if captured (or other conditions, such as harvesting, but that's getting a little ahead of what the above code would be able to support) would supply players with a resource.

2. With proper support for dynamic resizing and smart placement of these "units", we could have games about territory control that had nothing to do with the geometry of the maps. That would mean, among other things, that mappers could look at their art in a different context than, "I'm balancing this for EE/CA/Gundam/Whatever". I'm not claiming this would always be a good thing, but it might be a very interesting thing.

3. A script like this, designed as a Gadget, could just as well be a Widget or a Gadget that was tied to a map, etc.

4. This could be used, in a fairly crude fashion, to start directly supporting Units that were a part of maps. This is a really big deal, and, well, Smoth was going to get to this, but he's too busy with IRL stuff, so I'm hoping somebody picks up this ball and keeps it in play. Putting Units onto maps has a HUGE number of possible uses, including:

A. FX generators. Animated waterfalls, ocean spray by the beach, rolling banks of fog... the possible uses here are pretty much limitless.

B. Sound. Embedding sound into areas of a map would be easy- just create a Unit, and use a COB to control when the sound plays. Simple.

C. Non-player-controlled buildings that were animated, instead of just being boring, static, etc.

There are lots of other uses for this, frankly.

Now, why do this through invoking Units, instead of just doing it through LUA directly?

1. While using LUA directly would be just fine for FX (erm, assuming that the whole FX-through-LUA stuff takes off, which I assume it will) and sounds, it'd be silly to do for more complicated scripted objects, frankly. We already have an animation language, which, while not perfect, is good enough for this kind of stuff, and far better than some poor mapper needing to call for a LUA coder just to put an animated house into their map- what they should be able to do, in an ideal world, is to just go get that animated house from a common library of Units (basically, a "mod") and use it by just telling a piece of LUA where they want it to be. Much easier, frankly, than asking a bunch of people who are mainly visual artists to suddenly learn a programming language well enough to do whatever they want, and instead of forcing a mapper to do all of the work, it can be spread out, among BOS animators, modelers, skinners, etc.

2. The support in Spring, in terms of gameplay, etc., is totally straightforwards at that point. It's a bloody Unit. It has hitpoints, a Footprint, etc., etc., etc. This keeps things very straightforwards, and keeps cross-mod compatibility issues down. It's bad enough, that some mappers are STILL invoking OTA models on their !@#*! maps, even though there are many games out there, including all of mine, that does not list the OTA models as a dependency. But the bigger issue is going to be when, say, Lathan gets what looks like a totally mind-blowing package of buildings done... and they're just static, don't support equally mind-blowing FX when they blow up, cannot catch on fire, and make no sounds. That's lame. We shouldn't go there.

3. With even #2, let alone #3, we could have randomized versions of a given map, by changing the set of objects via a script! For example... what if a map had a large city that was part of it, and every time the map loaded, the layout of streets and buildings was different? How cool would THAT be? Wait, but what about maps where the forests are different each time? Wait, what about maps where... you get it, right?

So, er, can somebody please start looking into this? I know, I know, if I want it badly enough, I should code it myself. But I've already blown all of my freebie time for the week, frankly, and have to get my nose back to the grindstone on my current project, or it won't get done... that's just reality here. So don't just blow this off- this is a very powerful set of tools that could totally change how Spring maps look, feel, and behave.
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Post by TheFatController »

I'm working on a Gaia feature that spawns camps of 1944 units for Annihilation based mods, they'll always spawn out of LOS with units and a building and supply dumps (not on water or unbuildable slopes) and attack the player that discoveres them first (with very scaled down damage) leaving corpses with small reclaim reward and giving exp to the units that kill them.

I'm about half done now, but when I release it my code should be very helpful for what you want.
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Post by Nemo »

TheFatController wrote:...(with very scaled down damage) ...

Awww :P I want to see Panzerschrek teams wiping out squads of peewees!
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

I'm about half done now, but when I release it my code should be very helpful for what you want.
Naw, really? Heh. Ok, I'll wait for that and we'll kind've go from there.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

My orbital barrage spell did exactly what you ask for in 1. I'm pretty sure it will need updating before trying to run it in the current spring, but it worked then.

http://spring.clan-sy.com/phpbb/viewtopic.php?t=10055
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Post by TheFatController »

Nemo wrote:Awww :P I want to see Panzerschrek teams wiping out squads of peewees!
Oh I will try and balance them to be "real" based on the idea that annihilation units are probably made of tougher metals etc. enough explosives will def destroy light units, but no human will survive a laser shot hehe 8)
NightfallGemini
Posts: 59
Joined: 07 May 2005, 23:48

Post by NightfallGemini »

TheFatController wrote:I'm working on a Gaia feature that spawns camps of 1944 units for Annihilation based mods, they'll always spawn out of LOS with units and a building and supply dumps (not on water or unbuildable slopes) and attack the player that discoveres them first (with very scaled down damage) leaving corpses with small reclaim reward and giving exp to the units that kill them.

I'm about half done now, but when I release it my code should be very helpful for what you want.

hmm. wouldn't the old GMC trucks be kind of out of place? :s

though, it would work for "post-apoc" maps.

also, don't scale down the damage. :P it'd make creeping too easy.
Post Reply

Return to “Lua Scripts”