Supply system

Supply system

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

Moderator: Moderators

Post Reply
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Supply system

Post by SpikedHelmet »

Here's an idea I have for a supply system in Spring: 1944, and my basic question is how much of this can Lua accomplish. This idea relies on the following:

- All combat units with large-caliber weapons will have some sort of limited amount of ammo, with different behavioural states based on the amount of ammo. This ammo is depleted when the unit shoots. When the unit begins to run low on ammo, it starts to fire less often to conserve it, and a visual indication is given above the unit for the player to recognize it's running low on ammo (for instance, a blinking --ammo- graphic)
- Units are resupplied via "Depots", which automatically resupply all units within a certain radius. All units within this radius will be able to fire indefinately as they will have a constant resupply.
- These depots do not make Supplies, they simply act as a reservoir for combat units to be able to use the supplies. Actual supplies are generated by entirely seperate structures.
- Mobile ammunition carriers will act like depots with a much smaller range and with a depletable amount of resources themselves. An ammo carrier will automatically re-supply units near it but will run out of this supply and will have to go back to a depot in order to restock itself.

So what am I looking at, here?
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Re: Supply system

Post by Nemo »

/me slaps spiked

hold off on the requests until we know exactly what we're implementing :P
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Re: Supply system

Post by SpikedHelmet »

I'm not requesting anything yet, I'm asking how much would be possible via lua :P
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Supply system

Post by KDR_11k »

SpikedHelmet wrote:Here's an idea I have for a supply system in Spring: 1944, and my basic question is how much of this can Lua accomplish. This idea relies on the following:

- All combat units with large-caliber weapons will have some sort of limited amount of ammo, with different behavioural states based on the amount of ammo. This ammo is depleted when the unit shoots. When the unit begins to run low on ammo, it starts to fire less often to conserve it, and a visual indication is given above the unit for the player to recognize it's running low on ammo (for instance, a blinking --ammo- graphic)
- Units are resupplied via "Depots", which automatically resupply all units within a certain radius. All units within this radius will be able to fire indefinately as they will have a constant resupply.
- These depots do not make Supplies, they simply act as a reservoir for combat units to be able to use the supplies. Actual supplies are generated by entirely seperate structures.
- Mobile ammunition carriers will act like depots with a much smaller range and with a depletable amount of resources themselves. An ammo carrier will automatically re-supply units near it but will run out of this supply and will have to go back to a depot in order to restock itself.

So what am I looking at, here?
Heh, I recall implementing that in COB with GINTA :P.

It's fairly easy to do in Lua, I'd say use a unit variable (1024 or something) to store the ammo and use a list to communicate those values to unsynced (that's what I'm doing in Fibre). For all depots and ammo carriers just check for units in a certain radius and set their ammo to full. Reducing the rate of fire can be done by jamming the weapon or using get WEAPON_RELOADTIME (-weaponNum, reloadTime) with the time being in frames (Spring.SetUnitWeaponState(unit, weaponNum, {reloadtime=time}) with time in seconds for Lua).
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Supply system

Post by bobthedinosaur »

talk to archangel! me and him are working on somthing very similar for our battle tech mod. in fact if its okay with him ill send you a mini test mod we had that uses exactly that deposit and ammo supply vehicle idea, and works with an ammo amount gui.
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Supply system

Post by Gota »

Use my idea,the one i posted in the s44 thread.
HAHA,Now i know you wont and that means ull fail!!!!Muahahahaha.
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Re: Supply system

Post by Nemo »

Gota, I reiterate for the fourth time now - do not post in any S44 related thread. Your input is consistently worthless and self-pitying.


Anyways. I tried coding up something like our system, quantum took pity and rewrote my horrible butchering of the language, and now we're just fighting out the bugs. Hopefully we'll have something we can test with in a week or two.
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Supply system

Post by Gota »

Well if you put it that way i guess i have to dont i.
tombom
Posts: 1933
Joined: 18 Dec 2005, 20:21

Re: Supply system

Post by tombom »

Gota wrote:Well if you put it that way i guess i have to dont i.
I'm going to take a guess and say that you're going to post in an S44 thread again.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: Supply system

Post by LordMatt »

Maybe he should be banned then. If he's not going to respect the rules.
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Supply system

Post by Gota »

Lordmatt is my personnal stalker... :mrgreen:
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Supply system

Post by bobthedinosaur »

heres what me and archangle were working on for awhile. credits go to archangle for the lua scripting. permission to play with and use, just give him credits.
Image
also if you want to play with it you might need CA's CEG images
Post Reply

Return to “Lua Scripts”