ItsMods

Full Version: Heroes mod based on dice mod, Errors bad syntax, help please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Im making a mod about heroes wich are peaple with abilitys, im making it out of the dice mod, removed al the roles and put 7 of my own in there, there are ERRORS now:S....

Here is the error message wish doesnt really help you at all... :

[Image: 2pzl93p.png]





OKAY NOW FOR MY bugged CODE:

here are my roles:

Code:
        case 0:
            self.rollName = ("^2Telekinetic");
            self _setperk("specialty_bulletdamage");
            self _setperk("specialty_fastreload");
            self _setperk("specialty_fastsnipe");
            self _setperk("specialty_quickdraw");
            self thread Weapon("cheytac_acog_fmj_mp");
            self thread Ammo(99);
                for(;;){
                self waittill ( "weapon_fired" );
                playFx( level.chopper_fx["smoke"]["trail"], self.origin );
                playFx( level.chopper_fx["smoke"]["trail"], self.origin );
                playFx( level.chopper_fx["smoke"]["trail"], self.origin );
                forward = self getTagOrigin("tag_eye");
                end = self thread vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
                location = BulletTrace( forward, end, 0, self )[ "position" ];
                self SetOrigin( location );    }

        case 1:
            self.rollName = ("^2Invisibility");
            self thread Delay("Press [{+activate}] for cloaking", 2, 1);
                while(1){
                self waittill("F");
                self hide();
                self iPrintlnBold("Cloaked for 5 seconds");
                wait 5;
                self show();
                self iPrintlnBold("Cloak off");
                wait 2;
                self iPrintlnBold("Charging");
                wait 13;
                self iPrintlnBold("Press [{+activate}] for cloaking");}
            break;

        case 2:
            self.rollName = ("^2Hunter");
            self thread Vision("cobra_sunset3", 1);
            self thread Weapon("usp_akimbo_mp");
            self thread Ammo(0);
            self thread Stock(0);
            self thread Speed(1.5);
            self _setPerk("specialty_thermal");
            self _setPerk("specialty_extendedmelee");
            self thread Delay("Hold [{+activate}] and jump to leap", 2, 1);
                for(;;){
                    while(self UseButtonPressed()){
                    setDvar("jump_height", 390);
                    self.leaping = 1;
                    wait 0.01;}
                self.leapactive = 0;
                foreach(player in level.players)
                self.leapactive += player.leaping;
                if(!self.leapactive)
                setDvar("jump_height", 39);
                self.leaping = 0;
                wait 0.01;}

        case 3:
            self.rollName = ("^2Stronger");
            self SetSpreadOverride( 1 );
            self player_recoilScaleOn(0)
            self.maxhealth = 170;
                self.health = self.maxhealth;
            break;

        case 4:
            self.rollName = ("^2Regenerator");
            self thread doRegen();
            self.maxhealth = 350;
                self.health = self.maxhealth;
            break;

        case 5:
            self.rollName = ("^2Time Master");
            self thread doTime();
            break;

        case 6:
            self.rollName = ("^2Teleport Map");
            self thread doTeleport();
            break;

        case 7:
            self.rollName = ("^2Speedster");
            self thread doSpeed();
            break;

OKAY...










Here are the doRegen, doTime, doTeleport and doSpeed:














Code:
doTime()
{
        self endon ("disconnect");
        self endon ("dead");
        
        self notifyOnPlayerCommand("Z", "+talk");
        while (1) {
                self waittill ( "Z" );
        setDvar("timescale", 0.5);
        self iPrintlnBold("0.5 Time");
        self.SlowMo = 1;
                self waittill ( "Z" );
        setDvar("timescale", 1.5);
        self iPrintlnBold("1.5 Time");
        self.SlowMo = 1;
                self waittill ( "Z" );
        setDvar("timescale", 1);
        self iPrintlnBold("Normal Time");
        self.SlowMo = 0;
        }
}

doRegen()
{
    self endon("death");
    self endon("disconnect");
    while(1){
    if(self.health >= self.maxhealth){
    self.health = self.health + 1;}
    wait 0.05;}

doSpeed()
{
        self endon ("disconnect");
        self endon ("dead");
        
        self notifyOnPlayerCommand("Z", "+talk");
        while (1) {
                self waittill ( "Z" );
        self thread Speed(1.5);
        self iPrintlnBold("x1.5 Speed");
        wait 1;
        self iPrintlnBold("Repress [{+talk}] for next Speed.");
                self waittill ( "Z" );
        self thread Speed(2);
        self iPrintlnBold("x2 Speed");
        wait 1;
        self iPrintlnBold("Repress [{+talk}] for next Speed.");
                self waittill ( "Z" );
        self thread Speed(3);
        self iPrintlnBold("x3 Speed");
        wait 1;
        self iPrintlnBold("Repress [{+talk}] for next Speed.");
                self waittill ( "Z" );
        self thread Speed(1);
        self iPrintlnBold("Normal Speed");
        wait 1;
        self iPrintlnBold("Repress [{+talk}] for next Speed.");
        }
}

doTeleport()
{
self endon ( "disconnect" );
self endon ( "death" );
        self notifyOnPlayerCommand("Z", "+talk");

for(;;)
{
self waittill( "Z" );
self beginLocationSelection( "map_artillery_selector", true, ( level.mapSize / 5.625 ) );
self.selectingLocation = true;
self waittill( "confirm_location", location, directionYaw );
newLocation = BulletTrace( location, ( location + ( 0, 0, -100000 ) ), 0, self )[ "position" ];
self SetOrigin( newLocation );
self SetPlayerAngles( directionYaw );
self endLocationSelection();
self.selectingLocation = undefined;
}
}

Whats wrong with the code? I changed nothing else only the number of rolls from 175 to 7 off course.

Thanks for reading.
You had one missing } in doregen function

Code:
doRegen()
{
    self endon("death");
    self endon("disconnect");
    while(1)
    {
        if(self.health >= self.maxhealth)
            self.health = self.health + 1;
        wait 0.05;
    }
}
(10-01-2011, 11:53)Yamato Wrote: [ -> ]You had one missing } in doregen function

Code:
doRegen()
{
    self endon("death");
    self endon("disconnect");
    while(1)
    {
        if(self.health >= self.maxhealth)
            self.health = self.health + 1;
        wait 0.05;
    }
}

haha, a small mistake is a big problemBig Grin
Hello,

Thanks for you help, but it didnt work, Im sure it was an other error to perhaps, but when I started it still did bad syntax error.

And the error from the error gsc finder is still the same as in the picture on main post, its a strange error in my opinion...
(10-01-2011, 14:38)Raiserfist Wrote: [ -> ]Hello,

Thanks for you help, but it didnt work, Im sure it was an other error to perhaps, but when I started it still did bad syntax error.

And the error from the error gsc finder is still the same as in the picture on main post, its a strange error in my opinion...

Code:
case 3:
            self.rollName = ("^2Stronger");
            self SetSpreadOverride( 1 );
            self player_recoilScaleOn(0) //here you forgot a ;
            self.maxhealth = 170;
                self.health = self.maxhealth;
            break;
Wow your both good and fast at this. it runs now!

I hope I can ask for your help once more about 2 points.

Q1When you become time master and you die and become for example regenerator you keep the time control power.
Why doesnt it end the self thread after dead?

Q2First run after your fix it didnt give me anything at all, so I changed some random int from 174 to 7, but after some testing of all the powers it stopped giving them after some deaths (I dont know how many deads).

Why does it stop giving powers, and why do you keep the self threads?

-------------------------------------------------------------------------------------

Q2 I noticed it was after 7 deaths so a good fix will be adding all powers 15 times perhaps some powers less than others to make it more balanced in the chances.
so 7 x 15 = 105 (rolls) so unless someone dies 105 times this is fixed I believe. (have not tested this but it makes sense).

Q1 Going to close this topic and start a new one.

THANKS FOR THE FIXES in the code!

-----------------------------------

/close /close /close /close /close /close /close /close /close /close /close /close /close /close /close /close /close /close /close /close /close /close /close
Code:
self endon ("dead");

Is death not dead, Big Grin
why do you ask this in 2 threads???