Scarabrae

User avatar
Beavis
Posts: 708
Joined: Sat Dec 10, 2011 11:06 pm

Re: Scarabrae

Post by Beavis »

vistalize wrote:Damn death just owned u shift

BURN

That same elevator was in Ultra Renegades and there's one more map with that same (Don't really won't say problem) issue.
Image
AnniDv6
Posts: 1039
Joined: Mon Dec 12, 2011 3:25 pm

Re: Scarabrae

Post by AnniDv6 »

Looking into it right now. I'll do my best to try to break it and get the bug to happen. Going to host all of the current maps with jump pads first and see if playing scarabrea after does anything. More info would be useful. What maps did you guys play last night leading up to scarabrea and was it happening on both teams flag elevators or just one?

For now here's a version of the map with those elevators deleted. Owner if you see this download this .zip and extract the files into the br base/missions folder and let it replace to current scarabrea. Thanks
-Redacted-

Edit:
I found the source. Will send a hot fix patch to Owner a bit later today.
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Re: Scarabrae

Post by S_hift »

Good job death. I really appreciate this. Though scarabrae isn't exactly my favorite map. It is a favorite among the noobs
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: Scarabrae

Post by DaJ4ck3L »

Death666 wrote:Uhhhhhhhh. Damn dude you seriously need some medication or a hobby if this is what keeps you up at night.

I didn't break it. That bug has been around for ages I remember it happening way back in the day on cybertron and other annihilation servers, but it only happens every so often (literally almost never). It's nothing to do with the actual map file itself being changed, it never has been. I remember looking into it a long time ago thinking it was possibly a residual effect left over from another map being played that has launch pads, but I never found anything and at that time the server didn't have any other maps with launch pads that would've caused it so it's probably just a mod bug or just shitty tribes elevators being shitty.

The darkstar engine really doesn't handle moving objects well and sometimes they bug out. Also the later versions of annihilation have some jump pad and launch pad code that's coded into the mod which could probably cause this bug.

The elevator:

Code: Select all

					};
					instant Moveable "elevator_9x91" {
						dataBlock = "elevator9x9";
						name = "";
						position = "-402.901 282.339 182.136";
						rotation = "0 0 0.749924";
						destroyable = "True";
						deleteOnDestroy = "False";
						waypoint = "top";
						delayTime = "1693.36";
						Status = "up";
					};
I guess I can look into it again and maybe put an out of order sign on the button and a bottle of pills to save someone from having an extreme anxiety attack over not being able to ride the elevator up two meters.
ohhhh god i loled
Image
AnniDv6
Posts: 1039
Joined: Mon Dec 12, 2011 3:25 pm

Re: Scarabrae

Post by AnniDv6 »

Crow let me know if this code is sound.

The two maps that were causing the problem with all 9x9 elevators were Halfpipe_Extreme and Shooters_OnTheRocks. Basically after either of those maps were played any 9x9 elevator on any other map would use the same code that those maps set them to for their jump pad launchers.

This is the old code.

Code: Select all

function elevator9x9::onCollision(%this,%obj)
{
	%c = Player::getClient(%obj);
	if (floor(getRandom() * 30) == 0)
	{ 
		GameBase::playSound(%this, debrisLargeExplosion, 0);
		%velocity = 900; %zVec = 20;
		%rnd = floor(getRandom() * 3);
		if (%rnd == 0)
		{ 
		} 
		else if (%rnd == 1) 
		{
		} 
		else if (%rnd == 2) 
		{ 
		}
	} 
	else if (floor(getRandom() * 7) == 0)
	{ 
		GameBase::playSound(%this, debrisLargeExplosion, 0);
		%velocity = 900; %zVec = 20;
	} 
	else 
	{ 
		GameBase::playSound(%this, SoundFireMortar, 0);
		%velocity = 900;
		%zVec = 20;
	} 
	%jumpDir = Vector::getFromRot(GameBase::getRotation(%obj),%velocity,%zVec);
	Player::applyImpulse(%obj,%jumpDir);
} 
And this is what I came up with. It sets the elevator back to it's default unless it's named as a launchpad. It seems to work great, but I'm no experienced coder. I ripped the default elevator code straight from base scripts.vol, added the num == launchpad for the names of all launchers used in those two maps and removed the randomness. Honestly I don't understand what the random values were were trying to achieve in the original code aside from using a different sound?

Code: Select all

function elevator9x9::onCollision(%this,%object)
{
	%c = Player::getClient(%object);
	if(%this.num == "launchpad")
	{ 
		GameBase::playSound(%this, SoundFireMortar, 0);
		%velocity = 900;
		%zVec = 20;
		%jumpDir = Vector::getFromRot(GameBase::getRotation(%object),%velocity,%zVec);
		Player::applyImpulse(%object,%jumpDir);
	} 
	else 
{
	if(!Player::isDead(%object) && getObjectType(%object) == "Player")
		if (GameBase::getTeam(%this) == GameBase::getTeam(%object) || %this.noTeam != "" || GameBase::getTeam(%this) == -1) {
			if (GameBase::isActive(%this) && %this.loop == "" && GameBase::isPowered(%this)  && getSimTime() >= %this.delayTime) {
				if(Moveable::getPosition(%this) == 0 && (%this.triggered == "" || %this.delayTime + 1.5 < getSimTime()) && %this.triggerHit == "") { 
					%this.delayTime = getSimTime() + 2.0;
					%this.triggered = 1;
				}
				if( getSimTime() >= %this.delayTime ) { 
					Elevator::trigger(%this);
					return true;
				}
			}
			else if(GameBase::getDataName(%object) == AntipersonelMine) 
				AntipersonelMine::onCollision(%object,%this);
		}
	return false;
}
}

Code: Select all

					};
					instant Moveable "elevator_9x91" {
						dataBlock = "elevator9x9";
						name = "";
						position = "53.0121 -45.1875 94.9776";
						rotation = "0 0 0";
						destroyable = "True";
						deleteOnDestroy = "False";
						inmotion = "true";
						delayTime = "0";
						Status = "up";
						num = "launchpad";
					};
User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: Scarabrae

Post by DaJ4ck3L »

I would use something more like this Death. I'm not sure what %this.num returns, but I know that this mission variable works pretty good. Unless there's multiple pads that need different speeds and vectors, I'd probably just use the check on the mission name.

Code: Select all

function elevator9x9::onCollision(%this, %object)
{
	if($missionName == "Halfpipe_Extreme" || $missionName == "Shooters_OnTheRocks")
	{
		GameBase::playSound(%this, SoundFireMortar, 0);
		%velocity = 900;
		%zVec = 20;
		%jumpDir = Vector::getFromRot(GameBase::getRotation(%object),%velocity,%zVec);
		Player::applyImpulse(%object,%jumpDir);
	}
	else
	{
		Elevator::onCollision(%this, %object);
	}
}
This way it will work in all mods, and cause less errors. Different mods have different functions, and could have changed data from the original function.

For example.

Code: Select all

function Elevator::onCollision(%this, %object)
{	
	DebugFun("Elevator::onCollision",%this,%object);
	if($debug) 
		event::collision(%this,%object);
	
	if ( GameBase::getDamageState(%object) == Destroyed ) // Mine possiblity.
		return;

	%type = getObjectType(%object);
	if ( %type == "Mine" )
	{
		Anni::Echo("!! Elevator contacted Mine!");
		// Mine::Detonate(%object);
		// deleteObject(%object);
		return False;
	}
	// Anni::Echo("!! Elevator contacts "@%type@".");
	if(!Player::isDead(%object) && %type == "Player")
	{
		if(GameBase::getTeam(%this) == GameBase::getTeam(%object) || %this.noTeam != "" || GameBase::getTeam(%this) == -1)
		{
			if(GameBase::isActive(%this) && %this.loop == "" && GameBase::isPowered(%this) && getSimTime() >= %this.delayTime && Moveable::getPosition(%this) == 0)
			{
				if(Moveable::getPosition(%this) == 0 && (%this.triggered == "" || %this.delayTime + 1.5 < getSimTime()) && %this.triggerHit == "")
				{
					%this.delayTime = getSimTime() + 2.0;
					%this.triggered = 1;
				}
				if( getSimTime() >= %this.delayTime )
				{
					Elevator::trigger(%this);
					return true;
				}
			}
			else if(GameBase::getDataName(%object) == AntipersonelMine) 
				AntipersonelMine::onCollision(%object,%this);
		}
	}
	return False;
}
This function is a bit different than the base function, and if you used this for your onCollision function instead of just recalling the function with the two variables, then in other mods you would receive errors, from the anni specific functions like "Anni::Echo".

Also, you were correct by the extra shit that was in the original function. It's used to give players random speed/sounds in the original spring pad function. They just took out the random part, and added the vel/vec variable where they wouldn't be random, but left in the original code that could give random speed/sound.

Plasmatic or Sevnn did the same thing in anni with the SpringPad, which is what I was going to suggest you replace the 9x9 ele with originally, but I have a feeling it wouldn't give nearly the same result with the low 50 %vel. Although the original devs could of left it like this from the start as well. Never using the random function they made. I'm not sure, but I have seen in other areas where original Tribes devs didn't use stuff they made. They left in the random sounds, but set the speed and vector all the same. I would think that the Tribes devs left it like this, for it to be almost exact in your map file. Too lazy to check in a base scripts.vol.

Code: Select all

function SpringPad::onCollision(%this,%obj)
{
	if($debug) 
		event::collision(%this,%obj);

   %c = Player::getClient(%obj);
   if (floor(getRandom() * 30) == 0)
    { 
     GameBase::playSound(%this, debrisLargeExplosion, 0);
     %velocity = 50; %zVec = 475;
     %rnd = floor(getRandom() * 3);
     if (%rnd == 0)
      { 
      } 
     else if (%rnd == 1) 
      {
      } 
     else if (%rnd == 2) 
      { 
      }
    } 
   else if (floor(getRandom() * 7) == 0)
    { 
     GameBase::playSound(%this, debrisLargeExplosion, 0);
     %velocity = 50; %zVec = 475;
    } 
   else 
    { 
     GameBase::playSound(%this, SoundFireMortar, 0);
     %velocity = 50;
     %zVec = 475;
    } 
   %jumpDir = Vector::getFromRot(GameBase::getRotation(%obj),%velocity,%zVec);
   Player::applyImpulse(%obj,%jumpDir);
} 
If you wanted to make it more random, you could just change vel/vec variables in the different areas, and even add a few new ones in the "%rnd == 0, %rnd == 1, etc" section.

EDIT: Ahhhh, just noticed the num that you added in the instant block. Pretty slick man :D. Tbh your method there would probably be smarter (for making it more universal), but both will work in our server. Didn't even notice the instant block till after I made the reply lol.
Image
AnniDv6
Posts: 1039
Joined: Mon Dec 12, 2011 3:25 pm

Re: Scarabrae

Post by AnniDv6 »

Alright nice. I just wanted to make sure I didn't have the {, and }'s completely jacked up somehow because I edited it in notepad. It should be pretty universal as is though because if the 9x9 elevator on the map doesn't have the num = launchpad it just kicks back the the default elevator collision code from base, there are no anni functions in it.

And yeah the standard anni launchpads just didn't work for those maps I did try them out at first. They are a bit too small and don't have enough kick. These maps weren't made by the Dynamix devs, but by some community members probably way back in 98-99 and a lot of the code in the older maps tends to break something on the maps played afterwards. I've fixed most instances of this along the way, but I still need to go through some of these older maps and replace the trigger teleport functions with Plasmatics teleport code which is a lot more stable and universal and lets you have multiple random out drop points. They will all be updated with the next map patch.
User avatar
vistalize
Posts: 840
Joined: Thu Dec 08, 2011 11:20 pm

Re: Scarabrae

Post by vistalize »

Good job guys
Image
EvilTree{OZ}
User avatar
virus
Posts: 474
Joined: Wed May 22, 2013 10:27 pm
Contact:

Re: Scarabrae

Post by virus »

Keep us posted... Shift, you should of came sooner, though I don't think the comments would have changed much. :)
[NHOP]Virus
bo'sdad
Posts: 842
Joined: Fri Dec 09, 2011 4:02 pm

Re: Scarabrae

Post by bo'sdad »

the cap lock made every thing clear and easy to read also , thanks !
Post Reply