Get map size?

This is the development community to discuss tribes mod coding or to ask questions.

Moderator: Moderators

1 Sat Feb 14, 2009 7:33 pm

Is there a function (client and/or server sided) that will tell me what the boundaries of the map are?
User avatar
Freelancer
ɹǝɔuɐןǝǝɹɟ
 
Posts: 1864

2 Sat Feb 14, 2009 7:36 pm

there is now
Code: Select all
missionCenter.x
missionCenter.y
missionCenter.width
missionCenter.height
simTerrain.hazeDistance
simTerrain.perspectiveDistance
simTerrain.visibleDistance


Image
Quimica
Call me Mr. Picky.
 
Posts: 1053

3 Sat Feb 14, 2009 7:51 pm

Any way to get it client sided?
User avatar
Freelancer
ɹǝɔuɐןǝǝɹɟ
 
Posts: 1864

4 Sun Feb 15, 2009 9:55 am

No need for the plugin.
Code: Select all
// new for 3.x -Plasmatic
deletevariables("$MissionInfo:*");

%start = waypointtoworld("0 0");
%end = waypointtoworld("1024 1024");
$MissionInfo:X = getword(%start,0);
$MissionInfo:Y = getword(%start,1);
$MissionInfo:H = getword(%end,0)-$MissionInfo:X;
$MissionInfo:W = getword(%end,1)-$MissionInfo:Y;

echo("X: "@$MissionInfo:X);
echo("Y: "@$MissionInfo:Y);   
echo("H: "@$MissionInfo:H);
echo("W: "@$MissionInfo:W);   
User avatar
Plasmatic
Lead Developer
Lead Developer
 
Posts: 7059

5 Sun Feb 15, 2009 10:54 am

Meh, forget it, I found a workaround.
User avatar
Freelancer
ɹǝɔuɐןǝǝɹɟ
 
Posts: 1864

6 Sun Feb 15, 2009 12:18 pm

Plasmatic wrote:No need for the plugin.
Code: Select all
// new for 3.x -Plasmatic
deletevariables("$MissionInfo:*");

%start = waypointtoworld("0 0");
%end = waypointtoworld("1024 1024");
$MissionInfo:X = getword(%start,0);
$MissionInfo:Y = getword(%start,1);
$MissionInfo:H = getword(%end,0)-$MissionInfo:X;
$MissionInfo:W = getword(%end,1)-$MissionInfo:Y;

echo("X: "@$MissionInfo:X);
echo("Y: "@$MissionInfo:Y);   
echo("H: "@$MissionInfo:H);
echo("W: "@$MissionInfo:W);   


WaypointToWorld is not clientside.
User avatar
C--
Sorry....
 
Posts: 1502

7 Sun Feb 15, 2009 12:20 pm

Plasmatic wrote:No need for the plugin.
Code: Select all
// new for 3.x -Plasmatic
deletevariables("$MissionInfo:*");

%start = waypointtoworld("0 0");
%end = waypointtoworld("1024 1024");
$MissionInfo:X = getword(%start,0);
$MissionInfo:Y = getword(%start,1);
$MissionInfo:H = getword(%end,0)-$MissionInfo:X;
$MissionInfo:W = getword(%end,1)-$MissionInfo:Y;

echo("X: "@$MissionInfo:X);
echo("Y: "@$MissionInfo:Y);   
echo("H: "@$MissionInfo:H);
echo("W: "@$MissionInfo:W);   


illegitimate :) :) :)
User avatar
C--
Sorry....
 
Posts: 1502

8 Sun Feb 15, 2009 12:49 pm

That sucks. Here I made that plugin specifically for simTerrain.hazeDistance, simTerrain.perspectiveDistance, simTerrain.visibleDistance and now this scripted bulldoggy doo is thrown in my face. wtf.

Oh, and client-side that doesn't work. The plugin could work client-side, but by default it's server-only.
User avatar
NoFiXette
Captain
Captain
 
Posts: 2017

9 Sun Feb 15, 2009 7:53 pm

Sorry man, I figured that out after you made the plugin. I thought it may work client side.
You can get visible distance with laser damage, but anything else and the plugin is the way to go.
User avatar
Plasmatic
Lead Developer
Lead Developer
 
Posts: 7059

10 Sun Feb 15, 2009 8:22 pm

That's an interesting method. Never would've *EVER* thought of that.
User avatar
NoFiXette
Captain
Captain
 
Posts: 2017

11 Sun Feb 15, 2009 9:32 pm

Visible distance or map size? Lasers will only damage at visible or less, so I drop a bot towards a laser turret while throttling the speed. Works nice.
User avatar
Plasmatic
Lead Developer
Lead Developer
 
Posts: 7059

12 Tue Mar 24, 2009 10:00 pm

Great job plas, now implement an out of area damage option that teleports you to the opposite side of the map Tom and Jerry style!

Code: Select all
function alertPlayer(%player)
{
    GameBase::getLOSInfo(%player, 1000, "0 -1.57079 0");    //Find Floor
    %pos = GameBase::getPosition(%player);     //Find Player
    %alt = Vector::sub(%pos, $LOS::Position);    //Find Altitude
    %dif = Vector::sub(%pos, sprintf("%1 %2 0", ($MissionInfo:W / 2) + $MissionInfo:X, ($MissionInfo:H / 2) + $MissionInfo:Y));    //Find Center
    GameBase::setPosition(%player, Vector::add(%pos, Vector::add(%dif, %dif)));    //Set opposite of center
    if(!GameBase::getLOSInfo(%player, 1000, "0 -1.57079 0"))
        GameBase::getLOSInfo(%player, 1000, "0 -1.57079 0");    //Find Floor
    GameBase::setPosition(%player, Vector::add($LOS::Position, %alt));    //Match Altitude
}
User avatar
Perrinoia
Suggestion bot 9000
 
Posts: 9268

13 Wed Mar 25, 2009 1:10 am

Tribes Pac Man.
User avatar
Plasmatic
Lead Developer
Lead Developer
 
Posts: 7059

14 Wed Mar 25, 2009 7:17 am

lol that would be pretty cool if the mission borders were exactly where the terrain repeats.. so you wouldnt notice the teleport (much..)
robindegen
I ril pr0 men
 
Posts: 6672

15 Sat Apr 18, 2009 12:23 am

I was considering doing this in my labyrinth mission, but didn't have the code nor plugin back then... Perhaps it's time to release a new version of the old Labyrinth... You can never have enough. I'm already on #3 or 4.
User avatar
Perrinoia
Suggestion bot 9000
 
Posts: 9268

16 Sat Apr 18, 2009 11:36 am

Just made a massive packman style Labyrinth, but sometimes when you go OOB and get teleported to the other side, you end up in a wall.... In order to fix this, I would have to make the walls (at least the ones on the border of the mission area) not randomly rotated. They would have to match the rotation of the wall on the opposing border... And all the corners would have to be rotated the same. Lots of work, since the grid I used to make the maze was 14x14.

I'm using the big octogonal room in challs2 as the arena (one challs2 for the floor, another for the ceiling, humanwall\\wcorner32 as the walls).

MazePlayer.PNG
You can prevent your opponents from deploying turrets in the maze by controlling this switch.

MazeEditor.PNG
Each wall is positioned and rotated randomly around a marker on a grid.
User avatar
Perrinoia
Suggestion bot 9000
 
Posts: 9268

17 Sat Apr 18, 2009 1:02 pm

Very, Very, Very awesome.
unbanmid2
^ prime
 
Posts: 1168

18 Mon Apr 20, 2009 10:07 pm

Once I get the Walls positioned so OOB teleporting never places you in a wall, I think I'll release the mission as is...
Then we can have a competition to see who can design the best bases in it...

Keep in mind you only have 32 meters from floor to ceiling, and placing the base too close to the boundry means enemies can teleport straight to your base. Also, you can remove the markers under the center of each wall to prevent each wall from spawning when the mission loads, then you can place your base concepts where you removed the markers/walls.
User avatar
Perrinoia
Suggestion bot 9000
 
Posts: 9268

19 Tue Apr 21, 2009 7:37 am

Would be cool if the mazes were generated at run-time.
User avatar
NoFiXette
Captain
Captain
 
Posts: 2017

20 Tue Apr 21, 2009 10:53 am

Must lag like hell.
User avatar
Freelancer
ɹǝɔuɐןǝǝɹɟ
 
Posts: 1864

Next

Return to Coder's Hangout

Who is online

Users browsing this forum: No registered users and 0 guests