Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Heroes mod based on dice mod, Errors bad syntax, help please
#1
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.
Reply

#2
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;
    }
}
Reply

#3
(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
Reply

#4
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...
Reply

#5
(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;
Reply

#6
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
Reply

#7
Code:
self endon ("dead");

Is death not dead, Big Grin
Reply

#8
why do you ask this in 2 threads???
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help improper syntax but i dont know where Brandeeno 6 4,434 07-28-2013, 19:25
Last Post: Brandeeno
  How do you guys check for errors when scripting? akillj 6 4,384 06-15-2013, 10:48
Last Post: Yamato
  [TUTORIAL] Basic Syntax KrypTiK 0 2,024 12-29-2012, 20:33
Last Post: KrypTiK
  [TUTORIAL] Handling Errors in VB.NET KrypTiK 0 1,939 12-29-2012, 20:28
Last Post: KrypTiK
  Roll the Dice [BUILD 2] (25th Jun 2011) AZUMIKKEL 74 44,582 12-02-2012, 10:19
Last Post: Nekochan
  Syntax error :( denn4550 6 4,269 11-09-2012, 04:13
Last Post: DEUS
  Leecher claims credit for Roll the Dice in an interview AZUMIKKEL 16 9,007 10-22-2012, 23:17
Last Post: Arteq
  Roll The Dice 4 Bloopbloop 17 20,237 10-12-2012, 07:16
Last Post: tjb1389
  [Release] Roll the Dice MOD for MW3 JariZ 74 46,190 09-14-2012, 20:58
Last Post: hillbilly
  [Request] hired help to incorporate dice weapons into bots mod MauiDeath 3 4,057 08-20-2012, 08:26
Last Post: d0h!

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.