mission area

Post Reply
User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: mission area

Post by DaJ4ck3L »

use client tags. shooterclient / damagedclient in the on damage function.

and this for the leave / enter functions.

%client = Player::getClient(%this);
Image
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: mission area

Post by perrinoia »

Replace %friendlyfire = true; with return;

Don't do what crow said. That had nothing to do with anything.
Image
User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: mission area

Post by DaJ4ck3L »

perrinoia wrote:Replace %friendlyfire = true; with return;

Don't do what crow said. That had nothing to do with anything.
makes it easier to use in other functions.
Image
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: mission area

Post by perrinoia »

Oh, I see what Crow is talking about, now.
%object is shooter client, not player.

Code: Select all

	if(!%this.outArea || !Client::getControlObject(%object).outArea)
	{
		Client::sendMessage(%object, 0, "Shooter and target must be out of the mission area to cause or receive damage.");
		return;
	}
He wanted you to set Player::getClient(%this).outArea = 1; in function Player::leaveMissionArea(%this) and set Player::getClient(%this).outArea = ""; in function Player::enterMissionArea(%this) as well as leaving %this.outArea = 1; and %this.outArea = ""; in both functions so you could use clientID and playerID interchangeably in function Player::onDamage...

My suggestion is easier.
Image
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: mission area

Post by perrinoia »

Strange. You're missing the line %player.outArea = ""; but that should have no effect on the message playing.
---------- Find in Files ----------
> Searching for the string 'function Player::enterMissionArea'...
C:\Dynamix\Tribes\base\scripts\dm.cs(70,1): function Player::enterMissionArea(%player)
C:\Dynamix\Tribes\base\scripts\player.cs(299,1): function Player::enterMissionArea(%this)
C:\Dynamix\Tribes\base\scripts\Training_Towers.cs(385,1): function Player::enterMissionArea(%this)
> 3 occurrence(s) have been found.
Image
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: mission area

Post by perrinoia »

Sorry, I searched in base 1.40 and deleted the sub-directories, assuming everything else would be the same. I was wrong.
---------- Find in Files ----------
> Searching for the string 'function player::enterMissionArea'...
C:\Dynamix\trorbs\base\scripts\dm.cs(67,1): function Player::enterMissionArea(%player)
C:\Dynamix\trorbs\base\scripts\game.cs(871,1): function Player::enterMissionArea(%player)
C:\Dynamix\trorbs\base\scripts\objectives.cs(367,1): function Player::enterMissionArea(%this)
C:\Dynamix\trorbs\base\scripts\Training_Towers.cs(385,1): function Player::enterMissionArea(%this)
> 4 occurrence(s) have been found.
game.cs is executed when the server starts, but objectives.cs is executed every time a mission starts, so I could see how changes made to game.cs might get overlooked, if the mission ever changed. Likewise, if you modified objectives.cs, and your first mission doesn't execute that file, then I could see how it might get overlooked.

I'd modify all of them just to be on the safe side, or delete all but one to ensure the others don't overwrite the custom one.

However, I doubt this is what is going wrong for you, either... I'm betting the function isn't being called regardless of where it's stored.

Something is fishy with your mission area detection... That's my guess.

Are there any syntax errors in the console?
Image
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: mission area

Post by perrinoia »

Oh... That makes so much sense.

I highly suggest using Crimson Editor's "Find in Files" feature, by the way.
Image
Post Reply