Fastest Way to Change Water Level

Fastest Way to Change Water Level

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

Moderator: Moderators

Post Reply
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Fastest Way to Change Water Level

Post by REVENGE »

As far as I know, the only way to fake changing water levels is by raising and lowering the entire heightmap. There are a couple of different functions that I can use, so I'm wondering which function is the fastest, and whether or not this effect can be achieved instantaneously. Otherwise, I won't bother.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Fastest Way to Change Water Level

Post by Tobi »

Can definitely not be done instantaneously, unless you want fake water and just render some extra water with LuaOpenGL :-)

If you change water level (e.g. change land level) engine will have to re-path the entire map in the background etc. Not sure if it does this actually, but if it doesn't you have the problem of units being able to drive in the water and boats being unable to move in it.
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Fastest Way to Change Water Level

Post by REVENGE »

Tobi wrote:Can definitely not be done instantaneously, unless you want fake water and just render some extra water with LuaOpenGL :-)

If you change water level (e.g. change land level) engine will have to re-path the entire map in the background etc. Not sure if it does this actually, but if it doesn't you have the problem of units being able to drive in the water and boats being unable to move in it.
Well damn, gg to that idea then. :P
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Re: Fastest Way to Change Water Level

Post by Noruas »

A map where lava rises with fake water done in lua would be cool, forcing all players to move toward the middle of the map in about an hour.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Fastest Way to Change Water Level

Post by lurker »

Fund it.
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Re: Fastest Way to Change Water Level

Post by Noruas »

Free Unit in xta.
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Fastest Way to Change Water Level

Post by Evil4Zerggin »

Tobi wrote:Not sure if it does this actually
It didn't when I tried it.
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: Fastest Way to Change Water Level

Post by TheFatController »

I'm guessing it's possible to have a map with some sand bridges and land and a map gadget displaying a timer in the corner, say 5:00 counting down - then when it hit zero the game would auto pause and a loading screen would display "raising tide..." or "lowering tide..." and wait for all the players to do the calculations each time to raise and lower the sea level.

That would be mostly acceptable as a gimmick I think, it would be cool if all the tanks etc stuck on the bridges were stranded for 5 mins hehe
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Fastest Way to Change Water Level

Post by Argh »

Can you even do a sync operation, or a series of them, while paused?
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Fastest Way to Change Water Level

Post by REVENGE »

Argh wrote:Can you even do a sync operation, or a series of them, while paused?
Nope.

EDIT: Wait, maybe. You can spawn units can't you.
Masure
Posts: 581
Joined: 30 Jan 2007, 15:23

Re: Fastest Way to Change Water Level

Post by Masure »

Reminds me "full metal planet"
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Fastest Way to Change Water Level

Post by Evil4Zerggin »

Argh wrote:Can you even do a sync operation, or a series of them, while paused?
I doubt it. My understanding is that when paused, no game frames pass, and if no game frames pass, nothing synced happens.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Fastest Way to Change Water Level

Post by jK »

synced stuff don't run only in GameFrames...

(so you can give commands, start buildings, stop buildings ...)
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Fastest Way to Change Water Level

Post by CarRepairer »

Reminds me of Worms World Party sudden death.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Re: Fastest Way to Change Water Level

Post by Guessmyname »

Noruas wrote:A map where lava rises with fake water done in lua would be cool, forcing all players to move toward the middle of the map in about an hour.
Seeing as it's lava, that might actually be possible with clever workarounds:

1) Don't actually fiddle with the water level at all
2) The lava is rendered by LUA, and is set up (also by LUA) to destroy all units beneath a certain height (ie the lava level)

Thus, raising the level of lava is comparatively easy: just raise the visible lava and the 'plane of destruction' for units. The only catch is that this doesn't warn the pathfinder, which will probably result in units driving straight into the lava and dying when they really shouldn't...
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Fastest Way to Change Water Level

Post by REVENGE »

Ah, but your suggestion still has some merit, in that you could fake nice fixed lava volumes using what you suggested and a typemap. Mappers, utilize!
Post Reply

Return to “Lua Scripts”