How to get the actuall waterlevel..

How to get the actuall waterlevel..

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

Moderator: Moderators

Post Reply
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

How to get the actuall waterlevel..

Post by PicassoCT »

I have a Map, that has rising and falling waterlevel, which means, it is terraformed up and down. Now i need to know how high some point is currently in UnitScript. So i can compute the waterlevel at the moment.

Substitued the Enginecalls with PseudoCodeFuncs:

Code: Select all

totalWaterHeight=SgetActualHeight()-SgetHistoricHeight()
Now.. if i get the actuall height of a point, there is mapdeformation in the way. How do i actually know, the point has not been hammered hard into the ground via artillery?

Image

Anybody?
Attachments
Untitled-1.jpg
(33.83 KiB) Downloaded 3 times
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: How to get the actuall waterlevel..

Post by jK »

waterlevel := 0
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: How to get the actuall waterlevel..

Post by PicassoCT »

Yes, but viewed from a Unit, who is standing on constantly terraformed terrain (by the unit itself(down in centrAIls case/up by the Journeyman) (and viceVersa at the waterlevelTerraform) were is the heightlevel that once was the waterlevel.

Sorry for my unprecise problem description. I also concluded that i best find a diffrent sollution for this. I think, that if i use a gadget to collect all the waterlevel up, waterlevel down wishes, and have that gadget hand back the Maps WaterOffset, ill get more happy with this.

This way Artillery wont be able to infere with the miningprogress by map-deforming
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: How to get the actuall waterlevel..

Post by jK »

WATERLEVEL IS ALWAYS ZERO
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: How to get the actuall waterlevel..

Post by PicassoCT »

YESS. WATERLEVEL IS ALWAYS ZERO. BUT NOT THE STARTLEVEL IT HAD WHEN THE MAP WAS LOADED. IF I WANT THE WATERLEVEL TO GO UP OR DOWN, I HAVE TO ADD TO THAT OR SUBSTRACT TO THAT.

NOW IF A UNIT TERRAFORMS ITS GROUND OVER TIME, I STILL CAN ESTIMATE THAT. BLENDING A PASTMAP + WATEROFFSET AND A FUTUREMAP (WHICH MIGHT NEED A UPDATE, IF THE WATER GOES DOWN AND YOU CAN MINE MORE METAL). BUT WHAT HAPPENS IF MAPDEFORMATION SETS IN? WHERE IS YOUR UNIT NOW?

I CAN GET ITS CURRENT HEIGHT. WHICH MINUS THE WATEROFFSET- THE EXPECTED HEIGHT GIVES ME JUST WHAT I WANT. THE POSSIBLE OFFSET OF ARTILLERY CRATERS.

omg shouting match with a dev, what are the odds to come out of that, not looking totally stupid ^-^

I think i can solve this. I also think, stopping clueless morning posting, would greatly reduce the stress upon throats. Im also working on a Gadget which should avoid dozens of terraforming units pushing the ground forth and back.

Also. Object Orientated Programming. Its the Waterlevel. And the CoordinateSystemOrigin. I think i should leave now, before JK - oh now its to late.. not with the spade.. ouh.. im sorry... i really am... (not enough, not enough).. that one missed.. (i ll get you, and i ll show you were the water is).. so ill be not burried at zero, thats a relieve..<CLONK>
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: How to get the actuall waterlevel..

Post by knorke »

Spring.GetGroundOrigHeight
( number x, number z ) -> number y
:?:

IF THE WATER GOES UP BUT IT IS DECIDED TO STAY THE TERRAIN EVEN MORE SO HOW CAN YOU BE SURE THAT WATERLEVEL IS NOW ALL THE WAY MAXIMUM BUT IS IT ENOUGHT? TO KNOW YOU MUST BECOME LIKE WATER IT FILLS CUP NOW IS THE CUP BUT IS IT ON GROUND? NOW IS IN CLOUD.

Image
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: How to get the actuall waterlevel..

Post by PicassoCT »

drunken postings.. they are billed gates to a betaWorld..sorry..someTimes..if its easier to ask then to use Your head.. you do stupid stuff..
Post Reply

Return to “Lua Scripts”