Forums Index >> Modding >> How to get this script work?
Page : <1> :
You're missing a } in the end, and make sure function, if etc ain't capitalized
Something like that...ty art :)
But there is a } in end, and Functions are functions. Whats wrong it still freezes?
Datablock -> datablock, Function -> function, If -> if. All of them should start with lowercase not only function.
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.
I try this triv. The "If's" were both Ifs. :)
Now I post it again, the bolded ones are in lower case in my mission file.
f
unction NewFlag::onoutofbounds(%db, %flag)
{
%rot = %flag.rotation;
%newPos = ("52.546 45.7144 70.6158" @ " " @ %rot);
%flag.settransform(%newpos);
}
d
atablock powerupdata(GreenBase)
{
aiPickup = "0";
className = "PowerUpData";
emitterDuration = "0";
maxOff = "0";
minOff = "0";
shadow = "0";
shadowAnimation = "0";
sound = "PupOnSound";
startOn = "1";
staticShadow = "0";
shape = "game/data/shapes/common/scrumgoal.dts";
};
f
unction GreenBase::onenter(%db,%this,%tank)
{
%client = %tank.client;
%team = %client.team;
%name = %client.namebase;
%flag = %tank.getflag();
%flagtype = %flag.getname();
I
f(%flagtype $= "NewFlag")
{
%tank.incscore(1, 1, 1);
%flag.clearMount();
%flag.setTransform(VectorAdd(pickSpawnPoint(""),"0 0 10")); bottomprintall(%name@ " Has Scored A Goal For The Green Team!", 2, 1);}
d
atablock powerupdata(BlueBase)
{
aiPickup = "0";
className = "PowerUpData";
emitterDuration = "0";
maxOff = "0";
minOff = "0";
shadow = "0";
shadowAnimation = "0";
sound = "PupOnSound";
startOn = "1";
staticShadow = "0";
shape = "game/data/shapes/common/scrumgoal.dts";
};
f
unction BlueBase::onenter(%db,%this,%tank)
{
%client = %tank.client;
%team = %client.team;
%name = %client.namebase;
%flag = %tank.getflag();
%flagtype = %flag.getname();
I
f(%flagtype $= "NewFlag")
{
%tank.incscore(1, 1, 1);
%flag.clearMount();
%flag.setTransform(VectorAdd(pickSpawnPoint(""),"0 0 10")); bottomprintall(%name@ " Has Scored A Goal For The Blue Team!", 2, 1);
}
Last edited: Thursday, July 21, 2005 at 11:34:45 PM
Whats wrong...bad thing that I dont remember the thread I got this from long time ago, maybe theres solution.
PTT search found nothing when I entered part of this script. :o
Putti, this works. Heh, good find putti. When you change the datablock and function first letter to be bolted it will stay lowercase. :) You need to change the two If -> if.
f
unction NewFlag::onoutofbounds(%db, %flag)
{
%rot = %flag.rotation;
%newPos = ("52.546 45.7144 70.6158" @ " " @ %rot);
%flag.settransform(%newpos);
}
d
atablock powerupdata(GreenBase)
{
aiPickup = "0";
className = "PowerUpData";
emitterDuration = "0";
maxOff = "0";
minOff = "0";
shadow = "0";
shadowAnimation = "0";
sound = "PupOnSound";
startOn = "1";
staticShadow = "0";
shape = "game/data/shapes/common/scrumgoal.dts";
};
f
unction GreenBase::onenter(%db,%this,%tank)
{
%client = %tank.client;
%team = %client.team;
%name = %client.namebase;
%flag = %tank.getflag();
%flagtype = %flag.getname();
I
f(%flagtype $= "NewFlag")
{
%tank.incscore(1, 1, 1);
%flag.clearMount();
%flag.setTransform(VectorAdd(pickSpawnPoint(""),"0 0 10")); bottomprintall(%name@ " Has Scored A Goal For The Green Team!", 2, 1);}
}
d
atablock powerupdata(BlueBase)
{
aiPickup = "0";
className = "PowerUpData";
emitterDuration = "0";
maxOff = "0";
minOff = "0";
shadow = "0";
shadowAnimation = "0";
sound = "PupOnSound";
startOn = "1";
staticShadow = "0";
shape = "game/data/shapes/common/scrumgoal.dts";
};
f
unction BlueBase::onenter(%db,%this,%tank)
{
%client = %tank.client;
%team = %client.team;
%name = %client.namebase;
%flag = %tank.getflag();
%flagtype = %flag.getname();
I
f(%flagtype $= "NewFlag")
{
%tank.incscore(1, 1, 1);
%flag.clearMount();
%flag.setTransform(VectorAdd(pickSpawnPoint(""),"0 0 10")); bottomprintall(%name@ " Has Scored A Goal For The Blue Team!", 2, 1);
}
}
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.
Last edited: Friday, July 22, 2005 at 3:53:02 AM
function GreenBase::onenter(%db,%this,%tank)
{
%client = %tank.client;
%team = %client.team;
%name = %client.namebase;
%flag = %tank.getflag();
%flagtype = %flag.getname();
If(%flagtype $= "NewFlag")
{
%tank.incscore(1, 1, 1);
%flag.clearMount();
%flag.setTransform(VectorAdd(pickSpawnPoint(""),"0 0 10")); bottomprintall(%name@ " Has Scored A Goal For The Green Team!", 2, 1);}
}
STILL missing a }!
^Nope.
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.
Whaaaa?
Anyways, it works now. And I want to say this to everyone: dont use this, seems it does nothing :O
Stupid script.
Ps. Let this thread die now %)
Hey, I was going to agree with you putti, but I noticed something when I scrolled down. There is also a datablock for the newflag, which wasn't in the your latest post which I fixed up. In your first post there is this. Make sure you have that too!
d
atablock flagdata(NewFlag)
{
bounceStatic = "0.5";
bounceTerrain = "0.7";
category = "Flags";
className = "FlagData";
collISI = "200";
frictionTerrain = "0.4";
hardCollSound = "softCollSound";
hardCollVel = "1";
noPickup = "0";
shapeFile = "game/data/shapes/common/scrumball.dts";
snagFlagSound = "PupOffSound";
softCollVel = "1";
springCorrectScale1 = "2";
springCorrectScale2 = "0.99";
springRange = "0.3";
springVelScale = "1";
unstuckBoost = "10";
unstuckTime = "2500";
};
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.
Well, it does nothing because you didnt put the flag nor the base in the mission :P
Oh...trying again.
Did not work. Last time I post again...
f
unction NewFlag::onoutofbounds(%db, %flag)
{
%rot = %flag.rotation;
%newPos = ("52.546 45.7144 70.6158" @ " " @ %rot);
%flag.settransform(%newpos);
}
d
atablock powerupdata(GreenBase)
{
aiPickup = "0";
className = "PowerUpData";
emitterDuration = "0";
maxOff = "0";
minOff = "0";
shadow = "0";
shadowAnimation = "0";
sound = "PupOnSound";
startOn = "1";
staticShadow = "0";
shape = "game/data/shapes/common/scrumgoal.dts";
};
f
unction GreenBase::onenter(%db,%this,%tank)
{
%client = %tank.client;
%team = %client.team;
%name = %client.namebase;
%flag = %tank.getflag();
%flagtype = %flag.getname();
I
f(%flagtype $= "NewFlag")
{
%tank.incscore(1, 1, 1);
%flag.clearMount();
%flag.setTransform(VectorAdd(pickSpawnPoint(""),"0 0 10")); bottomprintall(%name@ " Has Scored A Goal For The Green Team!", 2, 1);}
}
d
atablock powerupdata(BlueBase)
{
aiPickup = "0";
className = "PowerUpData";
emitterDuration = "0";
maxOff = "0";
minOff = "0";
shadow = "0";
shadowAnimation = "0";
sound = "PupOnSound";
startOn = "1";
staticShadow = "0";
shape = "game/data/shapes/common/scrumgoal.dts";
};
f
unction BlueBase::onenter(%db,%this,%tank)
{
%client = %tank.client;
%team = %client.team;
%name = %client.namebase;
%flag = %tank.getflag();
%flagtype = %flag.getname();
I
f(%flagtype $= "NewFlag")
{
%tank.incscore(1, 1, 1);
%flag.clearMount();
%flag.setTransform(VectorAdd(pickSpawnPoint(""),"0 0 10")); bottomprintall(%name@ " Has Scored A Goal For The Blue Team!", 2, 1);
}
}
d
atablock flagdata(NewFlag)
{
bounceStatic = "0.5";
bounceTerrain = "0.7";
category = "Flags";
className = "FlagData";
collISI = "200";
frictionTerrain = "0.4";
hardCollSound = "softCollSound";
hardCollVel = "1";
noPickup = "0";
shapeFile = "game/data/shapes/tanks/brain.dts";
snagFlagSound = "PupOffSound";
softCollVel = "1";
springCorrectScale1 = "2";
springCorrectScale2 = "0.99";
springRange = "0.3";
springVelScale = "1";
unstuckBoost = "10";
unstuckTime = "2500";
};
And this in in mission file:
n
ew Flag() {
dataBlock = "newflag";
position = "23.8043 -19.9211 66.4136";
rotation = "0.0946489 -0.192491 0.976724 59.8902";
scale = "1 1 1";
lightBoost = "0";
};
I can get the flag (which I turned to brain to see if its different from original flag), but when I try to go the goals nothing happens.
Page : <1> :
datablock flagdata(NewFlag)
{
bounceStatic = "0.5";
bounceTerrain = "0.7";
category = "Flags";
className = "FlagData";
collISI = "200";
frictionTerrain = "0.4";
hardCollSound = "softCollSound";
hardCollVel = "1";
noPickup = "0";
shapeFile = "game/data/shapes/common/scrumball.dts";
snagFlagSound = "PupOffSound";
softCollVel = "1";
springCorrectScale1 = "2";
springCorrectScale2 = "0.99";
springRange = "0.3";
springVelScale = "1";
unstuckBoost = "10";
unstuckTime = "2500";
};
Function NewFlag::onoutofbounds(%db, %flag)
{
%rot = %flag.rotation;
%newPos = ("52.546 45.7144 70.6158" @ " " @ %rot);
%flag.settransform(%newpos);
}
Datablock powerupdata(GreenBase)
{
aiPickup = "0";
className = "PowerUpData";
emitterDuration = "0";
maxOff = "0";
minOff = "0";
shadow = "0";
shadowAnimation = "0";
sound = "PupOnSound";
startOn = "1";
staticShadow = "0";
shape = "game/data/shapes/common/scrumgoal.dts";
};
Function GreenBase::onenter(%db,%this,%tank)
{
%client = %tank.client;
%team = %client.team;
%name = %client.namebase;
%flag = %tank.getflag();
%flagtype = %flag.getname();
If(%flagtype $= "NewFlag")
{
%tank.incscore(1, 1, 1);
%flag.clearMount();
%flag.setTransform(VectorAdd(pickSpawnPoint(""),"0 0 10")); bottomprintall(%name@ " Has Scored A Goal For The Green Team!", 2, 1);}
Datablock powerupdata(BlueBase)
{
aiPickup = "0";
className = "PowerUpData";
emitterDuration = "0";
maxOff = "0";
minOff = "0";
shadow = "0";
shadowAnimation = "0";
sound = "PupOnSound";
startOn = "1";
staticShadow = "0";
shape = "game/data/shapes/common/scrumgoal.dts";
};
Function BlueBase::onenter(%db,%this,%tank)
{
%client = %tank.client;
%team = %client.team;
%name = %client.namebase;
%flag = %tank.getflag();
%flagtype = %flag.getname();
If(%flagtype $= "NewFlag")
{
%tank.incscore(1, 1, 1);
%flag.clearMount();
%flag.setTransform(VectorAdd(pickSpawnPoint(""),"0 0 10")); bottomprintall(%name@ " Has Scored A Goal For The Blue Team!", 2, 1);
}
I got this some time ago from someones thread, but when I try it my download bar freezes.