sty+ct+ivantis branch

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

sty+ct+ivantis branch

Post by ivantis »

okay, today and yesterday i buckled down and got my work to a somewhat stable point. get it from https://code.launchpad.net/~ivantis/arm ... ct+ivantis. it adds the features:
settings:

Code: Select all

WIN_ZONE_COLOR_[R, G or B] [decimal value] #change map-spawned win zone's color.
DEATH_ZONE_COLOR_[R, G or B] [decimal value] #change map-spawned death zone's color.
RESPAWN_PLAYER_RANDOM [player name] #respawns a player specified by player name at the LeastDangerousSpawnPoint
CHAT_COLOR 0x****** #change the default chat color
ADMIN_CHAT_COLOR 0x****** #change the default admin chat color
IMPERSONATE_NAME [name to impersonate] #for IMPERSONATE
IMPERSONATE [text] #makes it look like IMPERSONATE_NAME is talking
i think thats all the settings i added, there might be more
chat commands:

Code: Select all

/cookie [name] #finishes [name] and prints "* [player who sent command] gives [completed [name]] a cookie."
/suicide #kills the player that sent the command instantly
map feature:
this branch adds zone type teleport, and in <ShapeCircle for teleport zones, the settings xpos, ypos, xdir and ydir are added. when a player enters a teleport zone, it will kill then respawn them with those settings. for example:
<ShapeCircle radius="10" xpos="20" ypos="50" xdir="1" ydir="0"> will respawn the players that enter it at (20, 50) with direction settings (1, 0)
because of those settings, you can have a bunch of teleport zones all around the map teleporting to different places (i want to see some cool maps with this!)
this requires a special DTD, available at http://resource.space-lab.us/resource/i ... 8_hax2.dtd
i think thats all i added... tell me if you find anything else that wasnt in sty+ct
Last edited by ivantis on Thu Sep 11, 2008 10:58 pm, edited 1 time in total.
Image
Image
Image
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

oh yeah, i forgot. KILL_ALL is also a command. it works in a similar way to the void for respawning all players (and kills all players, duh)
Image
Image
Image
User avatar
hoop
Round Winner
Posts: 201
Joined: Tue Jul 24, 2007 7:45 am
Contact:

Post by hoop »

Good job :)
I like the teleport thing. How did you solve the bug that denied it to work after the first teleport?
/suicide sounds emo but it's a funny command XD
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

well :lol: , the truth is, this one has some really weird code in it. it uses different code than the original thing i was using for it, in which it reads the xml from the map to tell it where to respawn, and it uses RESPAWN_PLAYER

btw: BUG_ZONES_KILL_INVULNERABLE [boolean 0 or 1] is also a setting, it determines if death zones and shots should kill invulnerable players
Image
Image
Image
Pink Tomatoes
Average Program
Posts: 61
Joined: Fri Jul 25, 2008 11:24 am

Post by Pink Tomatoes »

I'm specifically interested in merging BUG_ZONES_KILL_INVULNERABLE into the current code I use,

How can I do that :)?

Sorry, I couldn't find an exact change file on bzr of your changes, only that there was nothing and then everything :D.

Thanks.
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

it only effects one file, gWinZone.cpp.
add these lines anywhere near the top (after all the #include lines):

Code: Select all

static int sg_dzKillInvulnerable = 0;
static tSettingItem<int> sg_dzKillInvulnerableConf( "BUG_ZONES_KILL_INVULNERABLE", sg_dzKillInvulnerable );
and add these lines into void gDeathZoneHack::OnEnter( gCycle * target, REAL time ) at the top:

Code: Select all

	if ((!target->Vulnerable()) && (sg_dzKillInvulnerable <= 0)) {
		//Checks to see if their cycle is invulnerable, don't kill invulnerable players
		return;
	}
Image
Image
Image
User avatar
hoop
Round Winner
Posts: 201
Joined: Tue Jul 24, 2007 7:45 am
Contact:

Post by hoop »

Code: Select all

(sg_dzKillInvulnerable <= 0)
why less than 0?
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

less than or equal to zero. its a toggle setting, like BUG_RIP. if it is greater than or equal to 1, it will kill the player, but if the bug setting is off, it will not kill the player
Image
Image
Image
User avatar
hoop
Round Winner
Posts: 201
Joined: Tue Jul 24, 2007 7:45 am
Contact:

Post by hoop »

uh, ok.
I just don't get the setting name, I'd call it something like DEATH_ZONE_KILL_INVULNERABLE
'BUG_ZONES' is not descriptive
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Post by epsy »

why isn't it a boolean? O_o
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

uh...
maybe it should be. do booleans take numbers instead of true or false?
Image
Image
Image
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Post by epsy »

from ingame (/admin BLAH 1) 1 maps to true and 0 maps to false
User avatar
hoop
Round Winner
Posts: 201
Joined: Tue Jul 24, 2007 7:45 am
Contact:

Post by hoop »

Pink Tomatoes and me have tested your hack right now and we realized that, with that setting activated, an invulnerable cycle should survive when it hits a shot, but not when it hits a death zone.
So now it looks like this:

Code: Select all

static bool sg_shotKillInvulnerable = 1;
static tSettingItem<bool> sg_shotKillInvulnerableConf( "SHOT_KILL_INVULNERABLE", sg_shotKillInvulnerable );

Code: Select all

	if (!dynamicCreation_ || ( deathZoneType == TYPE_NORMAL && !team ) )
	{
		target->Player()->AddScore(score_deathzone, tOutput(), "$player_lose_deathzone");
		target->Kill();
		sg_deathDeathZoneWriter << ePlayerNetID::FilterName(target->Player()->GetUserName());
		sg_deathDeathZoneWriter.write();
	}
	else
	{
		if ( !target->Vulnerable() && !sg_shotKillInvulnerable ) {
			//Checks to see if their cycle is invulnerable, don't kill invulnerable players
			return;
		}
[...]
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Post by epsy »

hoop wrote:

Code: Select all

static bool sg_shotKillInvulnerable = 1;
here it should be 'true', that would only compile with -fpermissive :)
User avatar
hoop
Round Winner
Posts: 201
Joined: Tue Jul 24, 2007 7:45 am
Contact:

Post by hoop »

whooops you're right :wink:
Post Reply