Difference between revisions of "ASSS Region"

From ASSS Wiki
Jump to: navigation, search
m (added dusted as a region editor)
m (changing md-> to mapdata->, mapdata was used earlier and is more descriptive than md. Obviously you would not have both md and mapdata declared as the same interface.)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
An ASSS Region is a region defined inside a map file. These can be arbitrary sets of tiles. Regions can have warpto coordinates, that will warp a player to a certain coordinate and/or arena when they enter the region. Regions can also have flags set for them that are understood internally by the server. These flags include: isBase (whether the region represents a base in a flag game), no antiwarp, no weapons, and no flag drops. They are understood internally using the mapdata interface. Regions are encoded in [[Extended .lvl Files]], and can be made using a python script from the [http://www.sscx.net/asss/ ASSS site], [[Continuum Level / Ini Tool]], or [[DustEd]].
+
An ASSS Region is a region defined inside a map file. These can be arbitrary sets of tiles. Regions can have warpto coordinates, that will warp a player to a certain coordinate and/or arena when they enter the region. Regions can also have flags set for them that are understood internally by the server. These flags include: isBase (whether the region represents a base in a flag game), no antiwarp, no weapons, and no flag drops. They are understood internally using the mapdata interface. Regions are encoded in [[Extended LVL|Extended LVL Files]], and can be made using a python script from the [http://www.sscx.net/asss/ ASSS site], [[Continuum Level / Ini Tool]], or [[DustEd]].
  
One can check if a tile is in a set or regions using this code:
+
One can check if a tile is in a region using this code:
  
 +
 +
== Code examples ==
 +
=== C ===
 
<pre>
 
<pre>
 
Region *myRgn = mapdata->FindRegionByName(arena,"myRegion");
 
Region *myRgn = mapdata->FindRegionByName(arena,"myRegion");
Line 8: Line 11:
 
int y = 512;
 
int y = 512;
  
if (myRgn && md->Contains(myRgn,x,y))
+
if (myRgn && mapdata->Contains(myRgn,x,y))
 
{ // your point is in the region
 
{ // your point is in the region
  
Line 18: Line 21:
  
 
</pre>
 
</pre>
 +
 +
=== Python ===
 +
See [[Writing_Modules_In_Python#Regions|Writing Modules In Python]].
 +
<!-- no point having duplicate code everywhere -->
 +
 +
 +
[[Category: ASSS]]

Latest revision as of 09:18, 2 August 2007

An ASSS Region is a region defined inside a map file. These can be arbitrary sets of tiles. Regions can have warpto coordinates, that will warp a player to a certain coordinate and/or arena when they enter the region. Regions can also have flags set for them that are understood internally by the server. These flags include: isBase (whether the region represents a base in a flag game), no antiwarp, no weapons, and no flag drops. They are understood internally using the mapdata interface. Regions are encoded in Extended LVL Files, and can be made using a python script from the ASSS site, Continuum Level / Ini Tool, or DustEd.

One can check if a tile is in a region using this code:


Code examples

C

Region *myRgn = mapdata->FindRegionByName(arena,"myRegion");
int x = 512;
int y = 512;

if (myRgn && mapdata->Contains(myRgn,x,y))
{ // your point is in the region

}
else
{ // your point is not in the region

}

Python

See Writing Modules In Python.