Forums Index >> Modding >> defaultGoal.getPosition(); - defaultGoal.getRotati...
Page : <1> :
Helloww? Anyone Please?
First create a powerup object named AntiCamper in the script. Like all the others are.
Define what happens when you enter the powerup like everything else is.
Then create and delete the powerup depending on where the goal is.
You cant use the defaultgoal.getposition() or anything like that to do this.
This is what I got at the moment
d
atablock powerupdata(AntiCamp)
{
category = "PowerUp";
shape = "game/data/shapes/AntiCamper/AntiCamper.dts";
type = "bounce";
shadow = false;
shadowAnimation = false;
startOn = true;
minOff = 1;
maxOff = 2;
Sound = "";
soundOff = "";
};
EDIT: Yehaa!! BreakTrough! I Got The Anti-CamperObject To Appear At The Right Place!! XD (Nothing More Yet Though)
f
unction CamperDamage(%tank,%loopsElapsed)
{
%loopsElapsed++;
%tank.player.hurtme(2.5);
%a1 = "SERVER RESPONSE ";
%a2 = "You're In AntiCamperArea!";
chatMessageClient(%sender, %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
if ( %loopsElapsed >= 10 || $inGoal[%tank] == false)
return;
schedule(1000,0,"CamperDamage",%tank,%loopsElapsed);
}
f
unction AntiCamp::OnEnter(%db,%this,%tank)
{
if (%tank.getFlag() != -1)
return;
$inGoal[%this,%tank] = true;
schedule(5000,0,"CamperDamage",%tank);
}
f
unction AntiCamp::OnLeave(%db,%this,%tank)
{
$inGoal[%this,%tank] = false;
}
n
ew PowerUp() {
dataBlock = "AntiCamp";
position = DefaultGoal.Position;
rotation = DefaultGoal.Rotation;
scale = "1 1 1";
lightBoost = "0";
};
Function Camperdamage & AntiCamp::OnLeave/onEnter Where Made By CS
Last edited: Sunday, September 10, 2006 at 8:54:32 AM
Close cassie, but thats not what he means. I had to do a lot of this, and I mean a lot, for rollerball.
package onCreateNewGoal {
function pickGoal()
{
if (!isObject(Goal))
{
new PowerUp(Goal)
{
dataBlock = DefaultGoal;
};
}
%posi = PickSpawnPoint("");
Goal.setTransform(%posi);
for (%i = 0; % < MissionCleanUp.getCount(); %i++)
{
%item = MissionCleanUp.getObject(%i);
if (%item.dataBlock $= "AntiCamp") {
%item.delete();
}
}
new PowerUp(AntiCamp) {
dataBlock = AntiCamp;
position = %posi;
};
return Goal;
}
};
ActivatePackage(OnCreateNewGoal);
I have an alternative, that if you need, I will provide
Hmm, doesn't seem to work.
Scoring is impossible, might it be because to PowerUps (AntiCamper & DefaultGoal) are on the same place?
Game/server/scripts/AC.cs (18): Unknown command hurtMe.
Object (1212) GameConnection -> GameConnection -> NetConnection -> SimGroup ->
SimSet -> SimObject
Last edited: Monday, September 11, 2006 at 10:17:08 PM
What the anti camper for Cassie :o
Page : <1> :
I've done this (AntiCamper)
new PowerUp() {
dataBlock = "AntiCamper";
position = DefaultGoal.getPosition();
rotation = DefaultGoal.getRotation();
scale = "1 1 1";
lightBoost = "0";
};
Then Dedicated Console says this:
Object 'AntiCamper' is not a member of the 'GameBaseData' data block class
game/server/scripts/special.cs (0): Unknown command getPosition.
Object DefaultGoal(80) DefaultGoal -> PowerUpData -> GameBaseData -> SimDataBl
ock -> SimObject
game/server/scripts/special.cs (0): Unknown command getRotation.
Object DefaultGoal(80) DefaultGoal -> PowerUpData -> GameBaseData -> SimDataBl
ock -> SimObject
game/server/scripts/special.cs (0): Register object failed for object (null).