• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

unlimited slope heights problem

Status
Not open for further replies.
Level 14
Joined
Apr 20, 2009
Messages
1,543
Hi all,

I need to know some information from some experienced terrainers.

My situation is as followed:

What I want to do is create a *base fortress* in the sky which should be available for a playable map. In order to do so I changed my Miscdata.txt and putted it in the UI map. So that my slopes have no limits. But what I can't understand is the following: how would I do it so that the game camera stays on top of the raised slope? And also: can I lower the slope limitlessly? Because for some apparent reason I'm not allowed to lower it more then 7-8 clicks >.>

an example of what I'm trying to achieve:
http://www.hiveworkshop.com/forums/...rtistic-style-using-mighty-alpha-tile-176544/

Look at the bridge picture. How would I set it up like that? I mean the bridge is way up but the ground is really low. How would I make sure that I can have my game camera on top of the bridge?
Would I need to set the cliff level to the lowest, then increase the slope and then what :S?

I'm using JNGP, Ultimate Terraining Map, Miscdata.txt and Mighty Alpha Tile.

How would I do this? I think it's got something to do with the cliff levels, I have no idea how to set them up correctly :S

Please help :(
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
The camera would probably need some script to enforce.

It is impossible to raise and lower terrain heights infinitly due to game engine limitations. You can however raise and lower them to the game's limit using such a modified file rather than the WE's limit.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Could you show me an example of such a script? I think I've seen it before in the diablo 3 map as I recall... Is it open source? I'll take a look...
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
But then wouldn't that mean that the camera has to be fixed onto that height? Meaning that for example the scroll wheel will not interupt such a height and that the camera will always stay at such a height? I really have no clue of setting it up correctly :S I guess a periodic event can do that?? I'll just goof around a bit :) thanks for your help Dr Super Good I'll try to figure it out :D

EDIT:
I think I got it to work. What I did was the following: create a dummy unit that is put on the terrain slope. I then stored GetLocationZ(udg_unit_loc)
in a variable to find the height of the terrain at the position of the unit.
Then I changed the height offset of the camera for all players to the stored variable +50 height. This all was put in a periodic event.
Haven't got a chance to test it but in theory it should work :) Thanks for the help ones again Dr Super Good.

EDIT2:
I did a test with a message to display the height of the terrain at the raised slope and the base height of the terrain. The raised slope is on 1907.75 and the base height on -29.75
Even though the camera height offset will be set to 1907.75+50 the camera will go down in height when I move off the slope. Anyone knows why this happens?

I literally tryed anything to make this work, nothing seems to work :(
This is my trigger so far:

  • Adjust camera height to slope height
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Set unit_loc = (Position of Peasant 0011 <gen>)
      • Custom script: set udg_Terrain_Height = GetLocationZ(udg_unit_loc)
      • Custom script: call SetCameraFieldForPlayer(Player(0) , CAMERA_FIELD_ZOFFSET , ( udg_Terrain_Height + 50.00 - GetCameraEyePositionZ() ) , 0.30)
      • Custom script: call RemoveLocation(udg_unit_loc)
Now my camera keeps moving up and down. Before I tryed doing it like this:

  • Adjust camera height to slope height
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Set unit_loc = (Position of Peasant 0011 <gen>)
      • Custom script: set udg_Terrain_Height = GetLocationZ(udg_unit_loc)
      • Camera - Set Player 1 (Red)'s camera Height Offset to (Terrain_Height + 50.00) over 0.30 seconds
      • Custom script: call RemoveLocation(udg_unit_loc)
This doesn't move my camera up and down but the height still decreases when moving off slopes. Same counts for the other trigger but then even more annoying >.>

I guess I'll have to do something like: if camera z offset < 1957.75 set it to 1957.75

How would I create the if?

I really need some help on this.

EDIT3:
I finally got it to work!!!

here is the trigger:
  • Adjust camera height to slope height
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Set unit_loc = (Position of Peasant 0011 <gen>)
      • Custom script: set udg_Terrain_Height = GetLocationZ(udg_unit_loc)
      • Custom script: call SetCameraField(CAMERA_FIELD_ZOFFSET, GetCameraField(CAMERA_FIELD_ZOFFSET) + udg_Terrain_Height - GetCameraTargetPositionZ() + 128, -0.01)
      • Custom script: call SetCameraField(CAMERA_FIELD_ZOFFSET, GetCameraField(CAMERA_FIELD_ZOFFSET) + udg_Terrain_Height - GetCameraTargetPositionZ() + 128, 0.01)
      • Custom script: call RemoveLocation(udg_unit_loc)
It's still a bit staggering in my opinion though. Any way to make it go smoother?
 
Last edited:
Level 14
Joined
Apr 20, 2009
Messages
1,543
Can I use a infinite loop for this? because right now it's really not going smooth at all :S I also tried increasing the camera interval, which does help a bit to make it run more smooth but then the camera will move really strange :(

Can I make a event on map start that starts an infinite loop that keeps doing this for the player?? I don't know how to create the loop though :S...

loop
exitwhen (1!=1)
endloop

Did not work :p Nor did creating a function that calls itself (recurring)...
 
Status
Not open for further replies.
Top