Forums Index >> Modding >> Script Help
Page : <1> :
Where did you put the datablock for the goal? Remember you need to create it
LOL! I forgot to add the datablock- silly me!
Will this do? (I am going to make the goal bigger later)
datablock PowerUpData(goall)
{
category = "Goal";
shape = "~/data/shapes/common/scrumgoal.dts";
type = "goal";
minOff = 0;
maxOff = 0;
startOn = true;
shadow = false;
shadowAnimation = false;
Sound = "PupOnSound";
soundOff = "";
};
It will go in the 'kothdumb.cs' or special.cs files right?
Last edited: Thursday, July 21, 2005 at 6:21:18 PM
Well I was trying to make a KOTH mod a long time ago... Here is what I got so far, but you just score once when in goal, go in and out to score more.
function goal1::onenter(%db, %this, %tank) {
bottomPrintall(%tank.client.namebase SPC "has control and is scoring!",5,2);
$goal1:schedule1 = %tank.schedule(1000, incscore, 1, 1, 1);
}
datablock PowerUpData(goal1)
{
category = "goal";
shape = "~/data/shapes/common/scrumgoal.dts";
type = "goal";
startOn = true;
shadow = true;
shadowAnimation = true;
aiPickup = true;
Sound = "PupOnSound";
soundOff = "PupOffSound";
};
Does that 1000 in 3rd line means time between scoring? Sry for posting here. :)
Change this:
schedule(1000, false, "score1", %obj.client);
to this:
schedule(1000, false, "score1", %db,%tank,%tank.client);
You werent passing the correct variables to the score1 function, you were passing the sub variable of %obj (a variable that didnt even exist) to it, that was being recieved as the form of %db, If you use the schedule I gave you it should work.
NOTE: That won't work right, even if another person entered the hill, it would give the old person scores too.
And imagine we enter and keep reenter the goal, then we'd have like 1000 points per second, you need to fix that!
Last edited: Friday, July 22, 2005 at 6:15:27 AM
NOTE: That won't work right, even if another person entered the hill, it would give the old person scores too.
And imagine we enter and keep reenter the goal, then we'd have like 1000 points per second, you need to fix that!
Yes, I know. This is what I want. I want it to give out 1 point per second.
Last edited: Friday, July 22, 2005 at 7:58:43 AM
The 1000 in the third line does mean time between scoring and it is in milliseconds. 1000 milliseconds = 1 second. So for every second you should get a point, but it doesn't work.
I don't see this in my script right now:
schedule(1000, false, "score1", %obj.client);
and when I try changing:
schedule(1000, incscore, 1, 1, 1);
to:
schedule(1000, false, "score1", %db,%tank,%tank.client);
I don't even score once now.
Function goall::onenter(%db, %this, %tank)
{
schedule(1000, false, "score1", %db,%tank,%tank.client);
}
Function score1(%db, %tank, %client)
{
%tank.incScore(1,1);
Bottomprintall(%tank.client.namebase SPC "has the hill!",5,2);
schedule(1000, false, "score2", %db,%tank,%tank.client);
}
Function score2(%db, %tank, %client)
{
%tank.incScore(1,1);
Bottomprintall(%tank.client.namebase SPC "has the hill!",5,2);
schedule(1000, false, "score1", %db,%tank,%tank.client);
}
Datablock PowerUpData(goall)
{
shape = "~/data/shapes/tanks/brain.dts";
shadow = true;
shadowAnimation = true;
startOn = true;
minOff = 0;
maxOff = 0;
Sound = "PupOnSound";
soundOff = "PupOffSound";
};
Lol try it!! The points come very quick, and bottomprints are weird...
f
unction goall::onenter(%db, %this, %tank)
{
schedule(1000, false, "score1", %db,%tank,%tank.client);
}
f
unction score1(%db, %tank, %client)
{
%tank.incScore(1,1);
Bottomprintall(%tank.client.namebase SPC "has the hill!",5,2);
schedule(10000, false, "score2", %db,%tank,%tank.client);
}
f
unction score2(%db, %tank, %client)
{
%tank.incScore(1,1);
Bottomprintall(%tank.client.namebase SPC "has the hill!",5,2);
schedule(10000, false, "score1", %db,%tank,%tank.client);
}
d
atablock PowerUpData(goall)
{
shape = "~/data/shapes/tanks/brain.dts";
shadow = true;
shadowAnimation = true;
startOn = true;
minOff = 0;
maxOff = 0;
Sound = "PupOnSound";
soundOff = "PupOffSound";
};
IT WORKS.
But its quite slow...and I've tried everything, cant fix the "has the hill!" bug. Change timer to what you want
PS. I bolded the functions and datablocks first letters becouse I found out that auto-capilization dont work with bolded letters ;) you can do straight copy&paste
It might be slow, because you have 10000 milliseconds = 10 seconds put...
Oh and with the the "has the hill" bug putti means that it says on the window. It even stays for the next round!
You don't have to let go of one rope before grabbing the other. But you'll have to let go of one if you want to swing forward.
With much help from putti's posts and eveyone els I have fixed all the bugs.
- When someone enters there name will show with the rest of the message.
- You get a point for every 10 seconds in the goal (every sec. Is too fast).
function goal1::onenter(%db, %this, %tank) {
bottomPrintall(%tank.client.namebase SPC "has control of the hill and is scoring!",5,2);
schedule(10000, false, "score1", %db,%tank,%tank.client);
}
function score1(%db, %tank, %client)
{
%tank.incScore(1,1);
schedule(10000, false, "score2", %db,%tank,%tank.client);
}
function score2(%db, %tank, %client)
{
%tank.incScore(1,1);
schedule(10000, false, "score1", %db,%tank,%tank.client);
}
datablock PowerUpData(goal1)
{
category = "goal";
shape = "~/data/shapes/common/scrumgoal.dts";
type = "goal";
startOn = true;
shadow = true;
shadowAnimation = true;
aiPickup = true;
Sound = "PupOnSound";
soundOff = "PupOffSound";
};
Last edited: Friday, July 22, 2005 at 1:29:01 PM
Without a return that schedule will keep increasing. You'll get more and more points every tick, because it repeats. Bad karma :P I would give you my KOTH script, but its... Anciant. First script mod ever, hey gimme some credit :)
I have a redone version for my scripting tutorial, it'll be up along with my new computer B)
[Ishbuu]
Im making Combo-gametype, where you can get points by picking brains from air (with boostpads helping) , playing CTF, CTB, KOTH and maybe BM.
Thank you all, it works without any bugs. And Racer, post here when its up, ill be there! %)
Actually, there is one bug, but I like it :) when you hit the KOTH-base, you dont have to sit in it, your scores are still counting. Thats fun. You can kill bots while the other players are attacking. :P
I will when I've finished the gametype for repent, while I don't, ask Ishbuu, maybe he can do it before I finish repent's
...heh trying to make a KOTH script that actually works like mine not to brag or anything...Will be glad to help...
-DmK-
Mine is better (tm)
It is, cause I overhauled it without use of new objects so HAHAHA. It works like it should, cause.... I'm a modding god :)
Modding God??? I've never seen your mods so you must mean scripting god???
I founded half of the modding methods you use today :) Particle nodes, new terrains, new skys, eventually new objects - after a lot of struggling... Oh and you can't forget the catagory of Scripting, thats my work... Beutiful isn't it?
Sorry bout that, just an ego trip, I like credit for things. 187 helped a lot too, she rocks :) I was more of a "behind closed doors" person, like the gears inside a clock, you give the hands and the face credit, but you don't know the gears are there.
EDIT: Credit where credit is due: -z- did the scripting way before 187 or Nate came to ThinkTanks. But I started the less... Official kinds :)
[Ishbuu]
Last edited: Tuesday, July 26, 2005 at 8:27:34 PM
But this koth type in this thread, is its own game. I created three bases which have that bug.
Actually, there is one bug, but I like it when you hit the KOTH-base, you dont have to sit in it, your scores are still counting. Thats fun. You can kill bots while the other players are attacking.
I have not a good name for it yet, how about "Capture the Bases"? When you have all the three bases, you are scoring very quick. %)
My Koth script works on a hill u dont have to be on the "purple thing" thing to score it has a certain area which u have to be in...
Page : <1> :
I'm just trying to make a simple KOTH mod. Here's what I came up with:
function goall::onenter(%db, %this, %tank)
{
schedule(1000, false, "score1", %obj.client);
}
Function score1(%db, %tank, %client)
{
%tank.incScore(1,1);
Bottomprintall(%tank.client.namebase SPC "has the hill!",5,2);
Schedule(1000, false, "score2", %obj.client);
}
Function score2(%db, %tank, %client)
{
%tank.incScore(1,1);
Bottomprintall(%tank.client.namebase SPC "has the hill!",5,2);
Schedule(1000, false, "score1", %obj.client);
}
And this in the mis:
new PowerUp() {
position = "-11.0834 -83.5893 99.9647";
rotation = "0.0320983 0.075679 -0.996615 47.2262";
scale = "1 1 1";
dataBlock = "goall";
lightBoost = "0";
But I get this:
Executing game/data/missions/TT3_3.mis.
Compiling game/server/scripts/kothdumb.cs...
Loading compiled script game/server/scripts/kothdumb.cs.
Object 'goall' is not a member of the 'GameBaseData' data block class
game/data/missions/TT3_3.mis (0): Register object failed for object (null).