Forums Index >> Modding >> Two scrum balls!!!
Page : <1> :
Actually it was from 56k.
The code is for 2 scrum ball and 2 goals. I imagie you can just modify it. I have been trying to assign the goal and balls to team. Haven't had much luck..
http://planetthinktanks.com/comm-thread.asp?thread=13546&forum=2&page=1
Package DualGoal {
function pickGoal()
{
if (!isObject(Goal2))
{
new PowerUp(Goal2)
{
datablock = DefaultGoal;
};
}
MissionCleanup.add(Goal2);
Goal2.setTransform(pickSpawnPoint(""));
// Add a second flag (if it doesn't exist)
if (!isObject(Scrum2))
{
%flag = new Flag(Scrum2)
{
datablock = DefaultFlag;
};
}
// make the new flag aware of the second flag (this makes it show on the radar.)
Scrum2.setGoal(Goal2);
// Spawn the other goal with the default function
Parent::pickGoal();
}
};
ActivatePackage(DualGoal);
Im also working on a new gametype called Heat the tank... One team trys to damage a tank while the other is constantly bringing powerups to it which "Heals" it heres what I have so far...
datablock PowerUpData(Going2behealed)
{
category = "Goal";
shape = "~/data/shapes/tanks/tank03.dts";
type = "goal";
minOff = 0;
maxOff = 0;
startOn = true;
shadow = false;
shadowAnimation = false;
Sound = "PupOnSound";
soundOff = "";
};
$Server::Gametype = "Heal The Tank";
{
};
Function Going2behealed::onEnter(%db, %this, %tank)
{
}
datablock PowerUpData(Going2behealed)
{
shape = "~/data/shapes/tanks/tank03.dts";
};
Function Going2behealed::onLeave(%db, %this, %tank)
{
messageall(10, %tank.client.namebase SPC " Please Come back and heal me more!",10);
}
datablock PowerUpData(Going2behealed)
{
shape = "~/data/shapes/tanks/tank03.dts";
};
Schedule(500,false,"createflag");
function createflag()
{
DefaultFlag.create(VectorAdd(pickSpawnPoint(""),"0 0 10"));
}
And for those who dont like that little script box...
Datablock PowerUpData(Going2behealed)
{
category = "Goal";
shape = "~/data/shapes/tanks/tank03.dts";
type = "goal";
minOff = 0;
maxOff = 0;
startOn = true;
shadow = false;
shadowAnimation = false;
Sound = "PupOnSound";
soundOff = "";
};
$Server::Gametype = "Heal The Tank";
{
};
Function Going2behealed::onEnter(%db, %this, %tank)
{
}
datablock PowerUpData(Going2behealed)
{
shape = "~/data/shapes/tanks/tank03.dts";
};
Function Going2behealed::onLeave(%db, %this, %tank)
{
messageall(10, %tank.client.namebase SPC " Please Come back and heal me more!",10);
}
datablock PowerUpData(Going2behealed)
{
shape = "~/data/shapes/tanks/tank03.dts";
};
Schedule(500,false,"createflag");
function createflag()
{
DefaultFlag.create(VectorAdd(pickSpawnPoint(""),"0 0 10"));
}
Damn scripting is so hard!
^I wish I could just delete that post :P
Radi8, you're doing it all wrong. The correct way to do it would be that there are various scrums arround the map, and players would pick em up and bring them for the tank being attacked... Only problem is, you can't know when you bumped that person... Or if you're near him (this one might be possible tough... Would have to find a good "limit" the tank to be healed must be from the tank with the heal powerup, and if it's inside that range heal him... Possible, but a bit complicated on finding the position limit, nonetheless, not even CLOSE to what you're doing)
I know! I said im just starting... And I was going to just start new anyways.
Defaultflag.create();
Page : <1> :
I dont know if this has been done before but... I made it so there are 2 scrum balls! Just find the little function on the CTF.cs and paste it at the very bottom of CTF.cs! Im still trying to get it to work for the special.cs.
(And also if you just keptg pasting it you could have as many scrum balls as you want! Cool huh?)