JazzJackrabbit Community Forums

JazzJackrabbit Community Forums (http://www.jazz2online.com/jcf/index.php)
-   JCS & Scripting (http://www.jazz2online.com/jcf/forumdisplay.php?f=5)
-   -   AngelScript Requests & Help (http://www.jazz2online.com/jcf/showthread.php?t=19503)

AvalancheMaster Jul 17, 2014 05:52 PM

Quote:

Originally Posted by Sir Ementaler (Post 483329)
Here's the kind of code I meant:
The number in red should be modified to the palshift parameter value you want to use. Notice this code doesn't require a snow event in the level.

Works like charm! One question left, though: is there a way to make it appear above all layers (layer 3, mainly)? Currently it reveals all secret passages in my level. If not, I'll just make it react with mask tiles immediately.

EDIT: Violet, I seem to have found a bug.

I've currently set:
Code:

        jjWeapons[WEAPON::BLASTER].infinite = false;
        jjWeapons[WEAPON::BLASTER].maximum = 99;
        p.ammo[WEAPON::BLASTER]==99;

However, when I run out of blaster, my ammo switches to the remaining bouncers I have, and correctly shows their number, but it never goes down. Basically it seems that it makes them "infinite".

Violet CLM Jul 17, 2014 06:02 PM

Quote:

Originally Posted by AvalancheMaster (Post 483335)
Works like charm! One question left, though: is there a way to make it appear above all layers (layer 3, mainly)? Currently it reveals all secret passages in my level. If not, I'll just make it react with mask tiles immediately.

Replace onDrawLayer4 with onDrawLayer3 or onDrawLayer1. :P

I'll look into the other thing. What's the context here? onLevelLoad or what? (And note that p is deprecated.)

AvalancheMaster Jul 17, 2014 06:14 PM

Here's the whole thing:

Code:

void onLevelBegin() {
        jjWeapons[WEAPON::BLASTER].infinite = false;
        jjWeapons[WEAPON::BLASTER].maximum = 99;
        p.ammo[WEAPON::BLASTER]=99;
}


cooba Jul 18, 2014 12:36 AM

I don't know about your problem, but you really need to make that into
Code:

jjPlayers[0].ammo[WEAPON::BLASTER] = 99;

Violet CLM Jul 18, 2014 01:03 AM

Not if it's a multiplayer level, which hopefully it is or else the infinite line is the only one that does anything. For multiplayer you'd want jjLocalPlayers[0]. (Alternatively, set maximum in onLevelLoad instead of onLevelBegin, which should take care of setting ammo to 99 all on its own.)

AvalancheMaster Jul 18, 2014 01:27 AM

It's a single player level.

EDIT: Bizarrely enough, when I get rid of p.ammo[WEAPON::BLASTER]=99;, the problem disappears.

Violet CLM Jul 18, 2014 01:42 AM

p is only supposed to work for onPlayer, onFunction#, and onPlayerTimerEnd, and even in those cases it's only there for backwards compatibility and you should define a jjPLAYER@ argument instead. Using p in onLevelBegin is undefined behavior.

AvalancheMaster Jul 19, 2014 11:43 PM

EDIT: Ok, no matter where I put jjWeapons[WEAPON::BLASTER].maximum = 35; it never works. How to fix this in singleplayer? Am I missing something?

Also, a question regarding FF. I managed to successfully turn the fastfire pickup into an ammo, but only for pre-places fastfire pickups. When an enemy drops fastfire, it acts as usual (no ammo, decreases bullets frequency).

Violet CLM Jul 20, 2014 12:56 AM

Quote:

Originally Posted by AvalancheMaster (Post 483350)
EDIT: Ok, no matter where I put jjWeapons[WEAPON::BLASTER].maximum = 35; it never works. How to fix this in singleplayer? Am I missing something?

Code:

void onLevelLoad() {
        jjWeapons[WEAPON::BLASTER].maximum = 35;
        jjWeapons[WEAPON::BLASTER].infinite = false;
}

I would think?
Quote:

Also, a question regarding FF. I managed to successfully turn the fastfire pickup into an ammo, but only for pre-places fastfire pickups. When an enemy drops fastfire, it acts as usual (no ammo, decreases bullets frequency).
Hmm... it looks like the code for dropping pickups like that (also used by crates) sets scriptedCollisions to false. (Also isTarget and triggersTNT, and deactivates to true.) This is conceivably a bug. You should be able to get around it by doing something like this:

Code:

void onLevelLoad() {
        jjObjectPresets[OBJECT::FASTFIRE].behavior = MyFastfire;
}
void MyFastfire(jjOBJ@ obj) {
        obj.scriptedCollisions = true;
        obj.behavior = BEHAVIOR::PICKUP;
        obj.behave();
}


AvalancheMaster Jul 20, 2014 06:05 PM

Quote:

Originally Posted by Violet CLM (Post 483351)
Code:

void onLevelLoad() {
        jjWeapons[WEAPON::BLASTER].maximum = 35;
        jjWeapons[WEAPON::BLASTER].infinite = false;
}

I would think?

No, it didn't work. But I managed to find a workaround with several ifs doing the job.

However, I've got another problem at hand. I'm trying to tint the ball platform to blue, but when I put jjObectPresets[OBJECT::BOLLPLATFORM].behavior = IceballPlatform; in onLevelLoad, no part of the code loads up. I even tried it with the simple rat example, given in the AngelScript guide (void MyRat(jjOBJ@ rat) {rat.behave(BEHAVIOR::LABRAT);}). It didn't work as well.

Here's the relevant part of the code:

Code:

onLevelLoad(){
        jjObectPresets[OBJECT::BOLLPLATFORM].behavior = IceballPlatform;
}
void IceballPlatform(jjOBJ@ plat) {
        plat.behave(BEHAVIOR::PLATFORM, false);
        jjDrawSpriteFromCurFrame(plat.xPos, plat.yPos, plat.curFrame, plat.direction, SPRITE::TINTED, 151);
}


Violet CLM Jul 20, 2014 06:24 PM

jjObjectPresets, with a j.

Blaster: how are you running the level? If you're cycling to it from another level that doesn't have that code, then you're going to start with 99 blaster left over from that previous level, and it won't be until you go below 35 that maximum is going to mean anything.

AvalancheMaster Jul 20, 2014 06:35 PM

Quote:

Originally Posted by Violet CLM (Post 483361)
jjObjectPresets, with a j.

Blaster: how are you running the level? If you're cycling to it from another level that doesn't have that code, then you're going to start with 99 blaster left over from that previous level, and it won't be until you go below 35 that maximum is going to mean anything.

Single player, first level off the pack.

Also, DID I REALLY fell for a typo mistake. x_

EDIT: And it still doesn't draw the chainlinks of the platform. Only the ball.

Seren Jul 21, 2014 07:42 AM

Quote:

Originally Posted by AvalancheMaster (Post 483362)
Also, DID I REALLY fell for a typo mistake.

That would suggest you don't have debug mode enabled. It's strongly suggested to have it on whenever you're doing anything with AngelScript. The readme introduction explains how to do that. You may also be interested in this download as, while it couldn't detect a mistake, said mistake would have never been made if the auto-completion feature were used.
Quote:

Originally Posted by AvalancheMaster
And it still doesn't draw the chainlinks of the platform. Only the ball.

That's because jjOBJ::behave, when its second argument is set to false, stops all drawing operations from the behavior. You could solve that by drawing the chain manually but in your case a simpler solution may be to just call behave with the second argument set to true. This will have the effect of your tinted sprite being drawn on top of the regular one, which should be visually identical to what you're trying to achieve.

AvalancheMaster Jul 21, 2014 03:10 PM

Quote:

Originally Posted by Sir Ementaler (Post 483366)

That's because jjOBJ::behave, when its second argument is set to false, stops all drawing operations from the behavior. You could solve that by drawing the chain manually but in your case a simpler solution may be to just call behave with the second argument set to true. This will have the effect of your tinted sprite being drawn on top of the regular one, which should be visually identical to what you're trying to achieve.

I did it, and it worked, but the chainlinks are still drawn as usual. It seems that I will have to code them as well.

Also, palshifting the bat does this:

[IMG]http://i.imgur.com/0yWQlvJ.png[/IMG]

I do realise it comes from the direction (capt'n obvious) yet I do not know how to solve it.

Code:
Code:

void Icebat(jjOBJ@ bat) {
        bat.behave(BEHAVIOR::BAT, true);
        jjDrawSpriteFromCurFrame(bat.xPos, bat.yPos, bat.curFrame, bat.direction, SPRITE::PALSHIFT, -56);
}


Violet CLM Jul 21, 2014 04:10 PM

I refer you to our discussion on the previous page of SPRITE::PALSHIFT not working with leftward facing sprites.

AvalancheMaster Jul 21, 2014 04:19 PM

Quote:

Originally Posted by Violet CLM (Post 483371)
I refer you to our discussion on the previous page of SPRITE::PALSHIFT not working with leftward facing sprites.



Damn. What about the chain links?

Violet CLM Jul 21, 2014 05:15 PM

Code:

void onLevelLoad(){
        jjObjectPresets[OBJECT::BOLLPLATFORM].behavior = IceballPlatform;
}
void IceballPlatform(jjOBJ@ plat) {
        int angle = 0;
       
        //get part of the angle before it moves
        if (plat.state == STATE::PUSH)
                angle = plat.var[4];
        else if (plat.state == STATE::ACTION || plat.state == STATE::FREEZE)
                if (plat.var[3] == 1) //U swing
                        angle = 1024 + int(jjSin(plat.var[4])*65536)/256;
                else
                        angle = plat.var[4];
       
        plat.behave(BEHAVIOR::PLATFORM, false);
        angle += plat.var[5] * plat.var[2];
                       
        //links
        int radius = 0;
        jjObjects[0].curAnim = plat.killAnim;
        jjObjects[0].frameID = 0;
        int frame = jjObjects[0].determineCurFrame(false);
        int radadd = 11; //one less than the width of the sprite, so change this if dealing with other platforms
        int angleadd = -plat.var[5];
        SPRITE::Mode mode = (plat.freeze != 0) ? SPRITE::FROZEN : SPRITE::TINTED;
        for (int n=0; n< plat.var[2]; ++n) {
                jjDrawSpriteFromCurFrame(
                        plat.xOrg + radius * jjSin(angle),
                        plat.yOrg + radius * jjCos(angle),
                        frame, 0,
                        mode, 151
                );
                angle+=angleadd;
                radius+=radadd;
        }
        //ball
        jjDrawSpriteFromCurFrame(plat.xPos, plat.yPos, plat.curFrame, plat.direction, SPRITE::TINTED, 151);
}


AvalancheMaster Jul 22, 2014 02:11 AM

Quote:

Originally Posted by Violet CLM (Post 483373)
Code:

void onLevelLoad(){
        jjObjectPresets[OBJECT::BOLLPLATFORM].behavior = IceballPlatform;
}
void IceballPlatform(jjOBJ@ plat) {
        int angle = 0;
       
        //get part of the angle before it moves
        if (plat.state == STATE::PUSH)
                angle = plat.var[4];
        else if (plat.state == STATE::ACTION || plat.state == STATE::FREEZE)
                if (plat.var[3] == 1) //U swing
                        angle = 1024 + int(jjSin(plat.var[4])*65536)/256;
                else
                        angle = plat.var[4];
       
        plat.behave(BEHAVIOR::PLATFORM, false);
        angle += plat.var[5] * plat.var[2];
                       
        //links
        int radius = 0;
        jjObjects[0].curAnim = plat.killAnim;
        jjObjects[0].frameID = 0;
        int frame = jjObjects[0].determineCurFrame(false);
        int radadd = 11; //one less than the width of the sprite, so change this if dealing with other platforms
        int angleadd = -plat.var[5];
        SPRITE::Mode mode = (plat.freeze != 0) ? SPRITE::FROZEN : SPRITE::TINTED;
        for (int n=0; n< plat.var[2]; ++n) {
                jjDrawSpriteFromCurFrame(
                        plat.xOrg + radius * jjSin(angle),
                        plat.yOrg + radius * jjCos(angle),
                        frame, 0,
                        mode, 151
                );
                angle+=angleadd;
                radius+=radadd;
        }
        //ball
        jjDrawSpriteFromCurFrame(plat.xPos, plat.yPos, plat.curFrame, plat.direction, SPRITE::TINTED, 151);
}


That's quite helpful, thanks! While I did not end up using it, it did help me create a platform chain out of the tileset. Now I'm trying to create the platform itself using the tileset, but I'm experiencing troubles with making it solid. As far as I understand drawTile only draws a tile and disregards mask, right?

Violet CLM Jul 22, 2014 02:22 AM

Quote:

int drawTile(int xPixel, int yPixel, uint16 tile, TILE::Quadrant tileQuadrant = TILE::ALLQUADRANTS)
Draws a tile of your choice at some position on the screen. This is purely a drawing operation; using it to draw masked tiles to the screen does not create masked areas for players or other objects to interact with.

AvalancheMaster Jul 22, 2014 02:50 AM

Quote:

Originally Posted by Violet CLM (Post 483375)

Ya, but I found a solution to this. A side question: can DrawTile use Resize modifier?

XxMoNsTeRXM Aug 4, 2014 01:05 AM

I want to verify if a player is at x-pos 53 and y-pos 79. I created a code but it doesn't work:

Code:

void onPlayer(jjPLAYER@ p) {
      if ((p.xPos / 32 == 53 && p.yPos / 32 == 79) && jjGameTicks % 70 == 0)
        jjAlert("Test");
}


Violet CLM Aug 4, 2014 02:13 AM

Instead of p.xPos / 32, try int(p.xPos / 32). Otherwise you're comparing a float to an integer and the chances are rather lower they'll be equal.

XxMoNsTeRXM Aug 4, 2014 02:47 AM

Quote:

Originally Posted by Violet CLM (Post 483527)
Instead of p.xPos / 32, try int(p.xPos / 32). Otherwise you're comparing a float to an integer and the chances are rather lower they'll be equal.

It worked, thanks!" also can you make a global timer? with timerStart to start it global, not player-based, or at least to verify the server game timer (server timer after pregame server timer), is it possible?

DennisKainz Aug 19, 2014 04:14 AM

I spent half an hour searching for a way to make the bats follow you all over the map.
All I found is that setting var[0] and var[11++] to 0 makes them chase you when you're close (and for some reason makes them shout while they're NOT awake and viceversa)
And setting these to anything else makes them NEVER chase you.
I also can't change their movement speed for chasing you.

I didn't want to bother you with more requests, but I can't do this by myself.

So, how do I give bats unlimited range? And how do I change their chasing speed?

Seren Aug 19, 2014 05:30 AM

Most of behavior constants for the majority of objects are hard-coded so you can't technically change only the distance bats detect you from or chase you from without rewriting the whole behavior. However, the position bats return to when they lose interest is their (xOrg, yOrg), so you could keep setting those to player's current position in order to make the bat chase them regardless of whether the range check succeeds. The variable you mention, var[0], stores ID of currently chased player, so you should use
Code:

const jjPLAYER@ player = jjPlayers[obj.var[0]];
obj.xOrg = player.xPos;
obj.yOrg = player.yPos;

or equivalent code. Speed values for bats are also more or less hard-coded but you can just adjust their position manually yourself. We established that xOrg and yOrg will always contain the position the bat is trying to reach so the code can look something like this:
Code:

obj.xPos = obj.xPos + (obj.xOrg > obj.xPos ? 2.f : -2.f);
obj.yPos = obj.yPos + (obj.yOrg > obj.yPos ? 2.f : -2.f);

Both of these pieces of code will naturally best fit in a custom behavior function that also calls the original behavior. However, at least the second one of them only makes sense to call when the bat is actually chasing somebody. You can make sure about that with a state check.
Code:

void bat(jjOBJ@ obj) {
        const jjPLAYER@ player = jjPlayers[obj.var[0]];
        obj.xOrg = player.xPos;
        obj.yOrg = player.yPos;
        obj.behave(BEHAVIOR::BAT);
        if (obj.state == STATE::FLY) {
                obj.xPos = obj.xPos + (obj.xOrg > obj.xPos ? 2.f : -2.f);
                obj.yPos = obj.yPos + (obj.yOrg > obj.yPos ? 2.f : -2.f);
        }
}


XxMoNsTeRXM Nov 2, 2014 02:57 AM

I got a code that does not work in multiplayer, it might be because it uses local variables, what I mean is that, if I join as a server it works, if I join as a normal player it crashes.
Code:

array savedgems(3, 0);
bool access = true;

void onPlayer(jjPLAYER@ p) {

 switch(p.health) {
            case 0:
                    if (access) {
                        savedgems[0] = p.gems[GEM::RED];
                        savedgems[1] = p.gems[GEM::GREEN];
                        savedgems[2] = p.gems[GEM::BLUE];
                        jjAlert("Red gems current: " + p.gems[GEM::RED]);
                        jjAlert("|Red gems saved: " + savedgems[0]);
                        jjAlert("Green gems current: " + p.gems[GEM::GREEN]);
                        jjAlert("|Green gems saved: " + savedgems[1]);
                        jjAlert("Blue gems current: " + p.gems[GEM::BLUE]);
                        jjAlert("|Blue gems saved: " + savedgems[2]);
                        access = false;
                        }
                        break;
                case 5:
                    p.gems[GEM::RED] = savedgems[0];
                    jjAlert("||Red gems loaded: " + p.gems[GEM::RED]);
                    p.gems[GEM::GREEN] = savedgems[1];
                    jjAlert("||Green gems loaded: " + p.gems[GEM::GREEN]);
                    p.gems[GEM::BLUE] = savedgems[2];
                    jjAlert("||Blue gems loaded: " + p.gems[GEM::BLUE]);
                    if (!access) access = true;
                    p.health = 4;
                    break;
        }

}


cooba Nov 2, 2014 03:09 AM

"Crashes" tells me nothing. Is it an Access Violation, or an other kind of error? If it's an Access Violation, what are the two addresses listed in the message?

XxMoNsTeRXM Nov 2, 2014 03:28 AM

Yea it is.
"At adress 0043CC2Bh by attempting to read from adress 9F763A48h"

EDIT: Maybe I gotta put [p.localPlayerID]? I tested that with the blaster reloading script, if I remove all the p.localPlayerID it crashes, if I have them, it works fine. I'll test that.

EDIT 2: Still not working...

Also here's the new magic code:

Code:

bool access = true;

class savedGems {
        savedGems() {
                red = green = blue = 0;
        }
        int red;
        int green;
        int blue;
};

array gemsArray(4);

void onPlayer(jjPLAYER@ p) {
        reloadBlaster(p);
        switch(p.health) {
            case 0:
                    if (access) {
                        gemsArray[p.localPlayerID].red = p.gems[GEM::RED];
                        gemsArray[p.localPlayerID].green = p.gems[GEM::GREEN];
                        gemsArray[p.localPlayerID].blue = p.gems[GEM::BLUE];
                        jjAlert("Red gems current: " + p.gems[GEM::RED]);
                        jjAlert("|Red gems saved: " + gemsArray[p.localPlayerID].red);
                        jjAlert("Green gems current: " + p.gems[GEM::GREEN]);
                        jjAlert("|Green gems saved: " + gemsArray[p.localPlayerID].green);
                        jjAlert("Blue gems current: " + p.gems[GEM::BLUE]);
                        jjAlert("|Blue gems saved: " + gemsArray[p.localPlayerID].blue);
                        access = false;
                        }
                        break;
                case 5:
                        p.gems[GEM::RED] = gemsArray[p.localPlayerID].red;
                        jjAlert("||Red gems loaded: " + p.gems[GEM::RED]);
                        p.gems[GEM::GREEN] = gemsArray[p.localPlayerID].green;
                        jjAlert("||Green gems loaded: " + p.gems[GEM::GREEN]);
                        p.gems[GEM::BLUE] = gemsArray[p.localPlayerID].blue;
                        jjAlert("||Blue gems loaded: " + p.gems[GEM::BLUE]);
                        if (!access) access = true;
                        p.health = 4;
                        break;
        }
}


Seren Nov 2, 2014 05:06 AM

The error is not caused by your script. Your script is technically correct (except for the accidental undefined reloadBlaster call in your latest post). The only problem it has is that p.health = 4; is a poor choice because, a) it's not obvious why this is done and b) the health change will cause a status update packet to be sent, which means unnecessary efficiency loss that could be avoided (finding a way to do so is left as an exercise for the reader).

The crash is most likely caused by the level alone but finding the cause proves troublesome. From the access violation error window, please provide the value of ESI.

XxMoNsTeRXM Nov 2, 2014 05:14 AM

reloadBlaster is not accidental, I didn't wrote the functionon the forum.

XxMoNsTeRXM Nov 2, 2014 05:52 AM

Welp... still not working, even though I am not changing health, I am just using it.
Let's try do it without even using health at all.

EDIT: There's no way I can make this without testing for health, I need a onDeath function.

Seren Nov 2, 2014 07:54 AM

I already said your script doesn't cause this error so your further modifications will not fix it. If I wanted you to avoid using the health variable, I would say so. What I said where I was talking about possible improvements to your script is that you should avoid writing to this variable when unnecessary because it involves additional actions, which in turn decrease efficiency, i.e. script execution speed. Most importantly, I never said avoiding its use would get rid of the error you experience, as that would be untrue. Now focus on what I wrote and notice I requested the value of the ESI register at the point of crashing that you can obtain from the error message. This is currently the only information from your side I'm interested in.

XxMoNsTeRXM Nov 3, 2014 04:01 AM

The ESI is 6h.

Also it would be possible to do my script on a function, instead of putting the death
pit on the level I could add a line of "Text" events in the level at the bottom of the level.

Seren Nov 3, 2014 12:45 PM

It appears that somewhere in your script you're trying to call jjPLAYER::showText on a non-local or undefined player. JJ2+ probably has a bug that makes this action potentially crash the game, thank you for the report; regardless of that though, calling it on a non-local player would have no effect and therefore also likely indicates a bug in your script. The call is likely to have a form of p.showText somewhere in the onLevelLoad hook function but that's just one of the possibilities. In case your code really contains references to the global variable p / jjP as the symptoms would suggest, you should consider completely refraining from its use, as mixing deprecated and new features may and will result in undefined behavior.

XxMoNsTeRXM Nov 4, 2014 04:20 AM

This is the only place I use show text:

Code:

void onLevelBegin() {
  p.showText("@@@@@@#Treasure Jail", STRING::LARGE);
       
}



There's something wrong... I tested another level without the code that originally I thought it crashed when other client joins. About 1 month ago that map worked successfully, no crashes on multiplayer, so... it... might be... something with my server?

cooba Nov 4, 2014 04:39 AM

That really should be
Code:

jjLocalPlayers[0].showText

XxMoNsTeRXM Nov 4, 2014 06:28 AM

Quote:

Originally Posted by cooba (Post 484100)
That really should be
Code:

jjLocalPlayers[0].showText

It actually is, that's the problem, I tested, I commented the p.showText and... cha-ching, works... lol... :lol:

It's interesting that people were able to join on my server 1 or 2 months ago, without any problem and it had
Code:

p.showText

then.

Everyone: Note that one line of your code could damage your entire level.

XxMoNsTeRXM Jan 10, 2015 12:36 AM

Quote:

Originally Posted by Primpy (Post 484928)
Ok, I obviously made a mistake, but I don't know where did I go wrong. I just tried to add the "Fall Damage" and "Wall Jumping" snippets. Argh, I don't even know how to modify two scripts.
Code:

int jumpKey = 0;
int fallTimer = 0;
const double maxFallTime = 4;
 
void onMain() {
  jjPLAYER@ p = jjLocalPlayers[0];
  p.ammo[2] = 3;
  if (p.keyJump == true) {
    jumpKey = jumpKey+1;
  } else {
    jumpKey = 0;
  }
 
  if (jjMaskedPixel(p.xPos + (p.direction * 13), p.yPos) && p.keyJump == true && jumpKey < 3) {
    p.ySpeed = -10;
    p.direction = p.direction * (-1);
    p.xSpeed = p.direction * 5;
//    && p.ySpeed < 0
  }
 
  if (jjMaskedPixel(p.xPos + 13, p.yPos)  && p.ySpeed > 0 && p.keyRight == true) {
    p.ySpeed = 1;
    p.alreadyDoubleJumped = false;
  }
  if (jjMaskedPixel(p.xPos - 13, p.yPos)  && p.ySpeed > 0 && p.keyLeft == true) {
    p.ySpeed = 1;
    p.alreadyDoubleJumped = false;
  }

 int fallTimer = 0;
const double maxFallTime = 4;
 
void onMain() {
    if (!jjMaskedPixel(p.xPos, p.yPos + 32) && p.ySpeed > 0) {
      fallTimer++;
  } else if (jjMaskedPixel(p.xPos, p.yPos + 32)) {
    int repeats = (fallTimer / 70) / maxFallTime;
                if (fallTimer >= maxFallTime) {
    for (int i = 0; i < (fallTimer / 70) / maxFallTime; i++) {
        p.health = p.health - 1;
        if (p.health < 0) p.health = 0;
    }
                }
      fallTimer = 0;
  }
    if (p.health == 0) {
        fallTimer = 0;
    }
}

AngelScript reminds me a little bit about LUA, but LUA was slightly easier, or at least on Roblox. Don't judge the Roblox players, it takes a lot of time to do a decent game and you need to know both modeling and programming...

Well... you got 2 "void onMain()", you gotta put both snippets into one "void onMain()", that might be the problem. I remember I did that too and I was like "Why isn't it working?", the chatlogger didn't give me any errors, and I realized I've got 2 of them.
Also you declared the variables "fallTimer" & "maxFallTime" twice.

(I moved this reply from the JJ2+ Thread to this thread)

Primpy Jan 10, 2015 01:52 AM

Quote:

Originally Posted by XxMoNsTeRXM (Post 484942)
Well... you got 2 "void onMain()", you gotta put both snippets into one "void onMain()", that might be the problem. I remember I did that too and I was like "Why isn't it working?", the chatlogger didn't give me any errors, and I realized I've got 2 of them.
Also you declared the variables "fallTimer" & "maxFallTime" twice.

(I moved this reply from the JJ2+ Thread to this thread)

Thanks a lot, I didn't notice I put two "void onMain()".

Primpy Jan 10, 2015 02:30 AM

Just wondering, but can Devan Shell be a playable character using Angel Script?


All times are GMT -8. The time now is 12:25 AM.

Powered by vBulletin® Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
JCF © 2001-Infinity Jazz2Online