Maps in HW2 are...

Moderators: Meurig, Spooky, Crook, Thursday

Locked
Anla-shok
Junior Member
Posts: 67
Joined: Wed Jun 04, 2003 12:00 am
Location: Auckland, New Zealand
Contact:

Post by Anla-shok » Thu Oct 16, 2003 3:57 pm

Easier than you think to implement.

Hi Guys,

From the relicnews forums:

</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">levelDesc = "DW Program Test"
maxPlayers = 2
player= {}

player[0] = {
id = 0,
name = "",
resources = 2000,
raceid = 1,
startPos = 1,
}

player[1] = {
id = 1,
name = "",
resources = 2000,
raceid = 1,
startPos = 2,
}

function DetermChunk()
c = 32000.0
a = 6500.0
addPoint("StartPos0", {0,0,31000}, {0,180,0})
addPoint("StartPos1", {0,0,-31000}, {0,0,0})
setWorldBoundsInner({0, 0, 0}, {38000,10000,38000})
--Ring of asteroids
for v = 0, 359, 4 do
addAsteroid("Asteroid_4",{c*sin(v),random(-1000,1000),c*cos(v)}, 30000,0,0,0,0)
end
addDustCloud("polySurface1","dustcloud_nores_m05",{0,1,0,1},0.0,31000.0)
end

function NonDetermChunk()
c = 32000.0
a = 6500.0
setLevelShadowColour(50, 0, 0, 0)
loadBackground("m05")
setSensorsManagerCameraDistances(1000, 90000)
fogSetActive(0)
setGlareIntensity(0)
setLevelShadowColour(0, 0, 0, 1)
--Fill in middle of the map
for v = 0, 2, 1 do
addNebula("Nebula4_OLD1","m07_foundry_radiation",{0,0,0},{1,1,1,1},0.0,29000.0)
end

--Generate rings
for v = 0, 360, 30 do
for u = 0, 360, 4 do
x = (c+a*cos(v))*cos(u)
y = a*sin(v)
z = (c+a*cos(v))*sin(u)
addNebula("Nebula4_OLD1","m07_foundry_radiation",{x,y,z},{1,1,1,1},0.0,3000.0)
end
end
end
</pre>[/QUOTE]NOT my coding.

To make this work:

Make sure you have the directory within the
homeworld 2 directory -
\Data\LevelData\multiplayer\deathmatch

Then copy and paste the above code into a new
notepad instance, and save as [yourfilenamehere].level
(choose your own filename here OBVI) inside the
'deathmatch' directory as above.

Play a 'Player vs. Comp' or 'multiplayer' game,
and goto the map labeled 'DW Program Test'.

Huge map, based on the mathematical formula of a
Torus. Don't go through the clouds - it'll kill
you [img]smile.gif[/img] . Have a play and leave a message at the
relicnews forums.


Anla-shok
*edited - to make look nicer*

[ 16. October 2003, 03:59 PM: Message edited by: Anla-shok ]
- Anla-shok -
website: <a href="http://www.dastudent.tk" target="_blank">www.dastudent.tk</a>
forum: Coming Soon
email: dastudent@dastudent.tk

bones_of_the_many
Posts: 577
Joined: Sat Mar 17, 2001 1:00 am
Location: Silicon Valley, USA
Contact:

Post by bones_of_the_many » Wed Oct 29, 2003 12:16 am

out of curiosity, is there a limit to how large a map could be?

if theres one thing i love its insanely huge maps...the larger the map the more strategy it takes. (the smaller the map the quicker you or the Ai dies)

things that make huge maps great:

- the thought that your reinforcements wont get there in time.

- the chance that you might encounter a superior fleet just about anywhere....although the chance is minimal.

- the long wait between resource dropoffs (if you dont use mobile refinery's)

- the insane cost it would take to hyperspace from point a to b (hypothetically speaking


- the necessary support vessels it takes when sending an attack fleet to distant locations. (remember that support, attack or damage, might take a while to get to your position.

all in all i like large maps. the larger the better. unfortunately there are no super-large maps yet.

Anla-shok
Junior Member
Posts: 67
Joined: Wed Jun 04, 2003 12:00 am
Location: Auckland, New Zealand
Contact:

Post by Anla-shok » Wed Oct 29, 2003 11:41 pm

Hi Guys

To answer a couple of your
questions, bones, here is the
map coding for the size of the
maps :

</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> setWorldBoundsInner({0, 0, 0}, {38000,10000,38000}) </pre>[/QUOTE]This line of code means that
the 'world' center is at
(0, 0, 0), and the size of the
map is 38000Wide * 10000High
* 38000Deep. Don't change the
(0, 0, 0) part, but change the
other 3 numbers to your hearts
content (ie, make the map as big
as you wish [img]smile.gif[/img] ).

Hope that helps, bones.


Anla-shok

bones_of_the_many
Posts: 577
Joined: Sat Mar 17, 2001 1:00 am
Location: Silicon Valley, USA
Contact:

Post by bones_of_the_many » Thu Oct 30, 2003 7:44 pm

oh excellent!

nowis there a way to edit the starting position of you and the AI?

Anla-shok
Junior Member
Posts: 67
Joined: Wed Jun 04, 2003 12:00 am
Location: Auckland, New Zealand
Contact:

Post by Anla-shok » Fri Oct 31, 2003 7:30 pm

Hi Bones

To answer a couple of your questions,
bones, here is the map coding for edit
the starting positions of players on
the map:

</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">addPoint("StartPos0", {0,0,31000}, {0,180,0})
addPoint("StartPos1", {0,0,-31000}, {0,0,0}) </pre>[/QUOTE]These lines of code means that the
starting position of player 0 (in
programming, arrays start with 0's,
but really they mean position 1) are
at 'world' coordinates of X=0, Y=0,
Z=31000. If you do the maths on the
tourus coding of the map, player 0
appears inside the torus +31000 units
away from the center of the map.

The '{0,180,0}' part of player 0 is
the direction the mothership faces
when entering the map. Get this wrong,
you could be wasting time getting the
mopthership to turn around. And only
change the middle coordinate, otherwise
you get a mothership on its side, also
wasting time to make itself upright.
The 180 means 'turn the mothership 180
degrees so that it is facing the center
of the map. Again, this could be a trial
and error thing (unless you are good at
visualising HW2 maps in your head [img]smile.gif[/img] )


Hope that helps, bones.


Anla-shok

PS. Player 0 = 1st player
PPS. Player 1 = 2nd player

bones_of_the_many
Posts: 577
Joined: Sat Mar 17, 2001 1:00 am
Location: Silicon Valley, USA
Contact:

Post by bones_of_the_many » Fri Oct 31, 2003 7:40 pm

of course it does. thanks again.

Anla-shok
Junior Member
Posts: 67
Joined: Wed Jun 04, 2003 12:00 am
Location: Auckland, New Zealand
Contact:

Post by Anla-shok » Fri Oct 31, 2003 8:51 pm

Hi Bones

You are welcome [img]smile.gif[/img]

So, putting it into practice, I'm
going to add a 3rd player to that
map. The player will be inside the
torus like players 1 and 2, but I'm
going to space them out equally.
I'll go though the changes step by
step. (Backup the original).

Step 1: Change the Maps name
</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">levelDesc = "Torus 3-Player"</pre>[/QUOTE]Step 2: Change the Maximum amount of players
</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">maxPlayers = 3</pre>[/QUOTE]Step 3: Add the 3rd player
</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">player[2] = {
id = 2,
name = "",
resources = 2000, -- Starting 'map default' resources
raceid = 1,
startPos = 3,
}</pre>[/QUOTE]Step 4: Add starting postion for
Player 3, and change positions for
players 1 and 2

</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">addPoint("StartPos0", {0,0,31000}, {0,180,0})
addPoint("StartPos1", {26847,0,-15500},{0,300,0})
addPoint("StartPos2", {-26847,0,-15500}, {0,60,0})</pre>[/QUOTE]I do hope my Trig was ok for that

Step 5: Save it as a new level

Step 6: Go play it [img]smile.gif[/img]


Let me know if there are any problems.


Anla-shok

[ 31. October 2003, 08:12 PM: Message edited by: Anla-shok ]
- Anla-shok -
website: <a href="http://www.dastudent.tk" target="_blank">www.dastudent.tk</a>
forum: Coming Soon
email: dastudent@dastudent.tk

User avatar
maxdamage
Posts: 2542
Joined: Tue Sep 02, 2003 12:00 am
Location: Gauteng, South Africa
Contact:

Post by maxdamage » Wed Nov 05, 2003 12:00 am

I can't find the folder and also tried creatng the directory structure but it causes the game to crash upon start of HW2.

maxdamage :(

Locked

Return to “Homeworld 2”