Forums Index >> Modding >> Why?
Page : <1> :
First off, I think you need to create a new datablock for your "death power-up".
Also the lack of "else if" in your code negates the other "if" statements
An example of a command the has permitters.
"if"
"else if"
"else if"
"else if"
"else"
the program seeks truth in a way. But you have to give it a true statement to match up with. So if it is not true with the first "if", it goes to the next or the next until it finds one that is true. So by leaving out the "else if" your not asking it to seek for truth your just telling it what truth is.
Therefor you just told the game that "all" power-ups hurt 100 units. (%tank.hurtMe(100);)
Try this:
_____________________________________________________
Create a datablock after heal.
Datablock PowerUpData(Death)
{
category = "PowerUp";
shape = "~/data/shapes/common/powerup.dts";
type = "health";
minOff = 90000;
maxOff = 120000;
startOn = false;
shadow = true;
shadowAnimation = true;
aiPickup = true;
Sound = "PupOnSound";
soundOff = "PupOffSound";
};
______________________________________________________
then In this section, after the health perhaps.
function PowerUpData::onEnter(%db,%this,%tank)
Else if (%db.type $= "death")
{
%tank.hurtMe(100);
%this.schedule(5000,"setDatablock","TestPowerup");
}
I did not test this, sorry if it doesn't work, but it may be a step closer.
and remember to un-capitalize the first letter of each line.
MAX
Last edited: Sunday, February 20, 2005 at 7:38:57 AM
Yah it worked.
question: what does the function/code look like in the special.cs for jumpads/boosites?
Datablock BoostData(TestBoost)
{
category = "Boost";
shape = "~/data/shapes/common/boostpad.dts";
type = "additive";
shadow = false;
advanceDelayOnEnter = 200;
numStates = 4;
StateName1 = "moe";
velocity1 = 24.5; <-----------------------------------------------------------
minDuration1 = 0;
StateName2 = "larry";
velocity2 = 24.5; <-----------------------------------------------------------
minDuration2 = 0;
StateName3 = "curly";
velocity3 = 24.5; <-----------------------------------------------------------
minDuration3 = 0;
StateName4 = "schemp";
velocity4 = 24.5; <-----------------------------------------------------------
minDuration4 = 0;
Sound = "ZoomSound";
};
Datablock BoostData(Boost4 : TestBoost)
{
numStates = 4;
};
Datablock BoostData(Boost1 : TestBoost)
{
numStates = 1;
};
Datablock BoostData(TestJump)
{
category = "Boost";
shape = "~/data/shapes/common/jumppad.dts";
type = "additive";
shadow = false;
NumStates = 1;
stateName1 = "";
velocity1 = 16.5; <-----------------------------------------------------------
Sound = "BlowSound";
};
Last edited: Monday, February 21, 2005 at 11:46:37 AM
@MAX
Yah, I kinda figured that. What I meant by my question was:
What if the keyword in that data block that increases your speed when you hit a boost, and what is the keyword that launches you in the air when you hit a jumppad?
Testboost.velocity1 = *;
testjump.velocity1 = *;
ect.
Last edited: Sunday, February 20, 2005 at 4:45:13 PM
Nope, it uses a secret code, (not realeased yet).
It reads those variables in the datablock and gives you the boost stated in them..
MoveMap.bind(keyboard,"ctrl c",Suicide);
function Suicide(%val)
{
If(%val)
{
LocalClientConnection.player.hurtme(9999999)
}
}
That will only work on your server if its not dedicated... But it will work
Not workin.
What did we miss?
I even tried it like this:
LocalClientConnection.%tank .hurtme(999999999);
And for some reason my new.cs file didnt create a.dso in the process?
Last edited: Monday, February 21, 2005 at 12:30:42 PM
You cant do that
it must be LocalClientConnection.player.hurtMe(9999999999);
And no idea.. I know how to get it to work but it would be much complicated than that
REMEMBER: THAT WILL ONLY WORK ON NON-DEDICATED SERVERS IF YOU'RE THE HOSTER!
PS: The first word of each line of code should be lower-case!!
Last edited: Monday, February 21, 2005 at 1:06:29 PM
@Art
Yah, it works. I had to add the code to the top of my.mis file as aposed through adding the code to my scripts folder.
Just wondering:
How would you swtich through the various types of tanks using only one ".bind". As aposed to using four seperate codes for the 4 other tanks?
Well, you can use Master TMO's tank toggler (get it at the old modding resource, dont know if its in the new one too)
bu to get a little key to do it is impossible, we need a script
O darn.
Anyways, I been trying to make a heal gate:
I added these two datablocks to my speical.cs:
datablock PowerUpData(HealGate)
{
category = "PowerUp";
shape = "~/data/shapes/common/recharge.dts";
userseq1 = "activate";
type = "ammo";
shadow = true;
staticShadow = true;
SoundOff = "ReloadSound";
};
And I made a custom function for it, but that doesnt seem to be the problem.
Then, after adding one of these to the acording.mis file:
new PowerUp(HealGate) {
position = "-11.0834 -83.5893 99.9647";
rotation = "0.0320983 0.075679 -0.996615 47.2262";
scale = "1 1 1";
dataBlock = "Healgate";
lightBoost = "0";
Then, when I host my mission.
I get this in the.dos window:
"HealGate is not a member of the GameBaseData"
some shit like that.
Whys that?
The datablock is in the spiecal.cs!
In other words:
How would I add a new datablock to my GameBaseData?
[
Last edited: Wednesday, February 23, 2005 at 2:33:12 AM
Page : <1> :
Um,so,your point?
%tank.hurtMe(100);
^ That means you will get 100 points of damage when you activate the function thingy.