Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Open Forums » JCS & Scripting

AngelScript Requests & Help

Reply
 
Thread Tools
Love & Thunder Love & Thunder's Avatar

JCF Member

Joined: Sep 2011

Posts: 1,101

Love & Thunder has disabled reputation

Jan 10, 2015, 07:12 AM
Love & Thunder is offline
Reply With Quote
It should be possible as a simple sprite swap, I think.

Anyway, I'm having trouble getting an enemy surge working. The code is mostly a modified version of some code from plusEnscripted.
It turns up no errors, and the "Surge incoming" text comes up, but no enemies spawn. The coordinates of where I want to spawn stuff is between 237 and 247 widthwise, and 35 heightwise, according to JCS.
Code:
uint elapsed = 0;
bool surge = false;
int slain = 0;
const int SLAINTARGET = 10;
bool surgeover = false;

void onMain() {
    if (surge == false) {
        elapsed = 0;
    } else {
        elapsed ++;
    }
    if ((jjTriggers[5] == true) && (surgeover == false) == true) {
        if (surge == false) {
            jjLocalPlayers[0].showText("@@@@@SURGE INCOMING!", STRING::LARGE);
        }
        doEnemySurge();
    }
}

void doEnemySurge() {
    if (surge == false) {
        surge = true;
    }
    if (slain < SLAINTARGET) {
        if (elapsed % 70 == 0) { //Once per second
            uint16 randomTarget = (237 + (jjRandom()&15)) * 32;
            jjOBJ@ obj = jjObjects[jjAddObject(OBJECT::LIZARD, randomTarget, 1120)];
            obj.state = STATE::FALL;
        }
    } else { //slain >= SLAINTARGET: surge is over
        surgeover = true;
        jjMusicLoad("carrotus.j2b");
        jjLocalPlayers[0].showText("@@@@@SURGE COMPLETE!", STRING::LARGE);
        for (int i = 0; i < jjLocalPlayerCount; i++) {
            jjLocalPlayers[i].limitXScroll(43, 0);
        }
        elapsed = 0;
    }
}
Oh, also I'm triggering it using a trigger crate.

EDIT: Turns out that they're just invisible.
So, now my question is, why are they invisible, and how can I get them visible?
EDIT 2: I've placed other lizards in the level, but the ones coming from this script are still invisible.
EDIT 3: Wait, I fixed it.
Turns out it was the "STATE::FALL" that was the problem. Switching it to either a Float Lizard or removing that line fixes it.

I apologise for the slightly useless post. XD

EDIT 4: New problem: void onObjectHit(jjOBJ@ object, jjOBJ@ bullet, jjPLAYER@ player, int force) isn't triggering.
__________________

Last edited by Love & Thunder; Jan 10, 2015 at 08:08 AM.
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Jan 10, 2015, 11:50 AM
Violet CLM is offline
Reply With Quote
onObjectHit is only called for objects with scriptedCollisions set to true.

The trouble with trying to make Devan a playable character in AngelScript is that you'd still see the rabbit sprites. You could do stuff with jjPLAYER::cameraFreeze, maybe offset layer 4 some number of tiles to the side and edit every behavior so it offsets its sprites accordingly, but that would be a pretty big hassle. Or you could stick Jazz in a wall somewhere and write your own platforming engine for Devan from scratch. Or you could decide it's probably not a great idea for 4.3.
__________________
Love & Thunder Love & Thunder's Avatar

JCF Member

Joined: Sep 2011

Posts: 1,101

Love & Thunder has disabled reputation

Jan 10, 2015, 01:55 PM
Love & Thunder is offline
Reply With Quote
Bullets are now going through multiple enemies, and although it does kill them, the kill counter still isn't going up.

Also, enemies are invincible in the air, and they only spawn at the two edges of the area I've specified for them to spawn in.
__________________
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Jan 10, 2015, 02:15 PM
Violet CLM is offline
Reply With Quote
Without knowing what the code looks like, it's pretty much impossible to point at what you're doing wrong.
__________________
Love & Thunder Love & Thunder's Avatar

JCF Member

Joined: Sep 2011

Posts: 1,101

Love & Thunder has disabled reputation

Jan 11, 2015, 01:02 AM
Love & Thunder is offline
Reply With Quote
Code:
uint elapsed = 0;
bool surge = false;
int slain = 0;
bool surgeover = false;

void onMain() {
    if (surge == false) {
        elapsed = 0;
    } else {
        elapsed ++;
    }
    if ((jjTriggers[5] == true) && (surgeover == false) == true) {
        if (surge == false) {
            jjLocalPlayers[0].showText("@@@@@SURGE INCOMING!", STRING::LARGE);
        }
        doEnemySurge();
    }
}

void doEnemySurge() {
    if (surge == false) {
        surge = true;
    }
    if (slain < 10) {
        if (elapsed % 70 == 0) { //Once per second
            uint16 randomTarget = (237 + (jjRandom()&8)) * 32;
            jjOBJ@ obj = jjObjects[jjAddObject(OBJECT::FLOATLIZARD, randomTarget, 1024)];
            obj.state = STATE::FALL;
            obj.var[5] = 0;
            obj.scriptedCollisions = true;
        }
    } else { //slain >= 10: surge is over
        surgeover = true;
        jjMusicLoad("carrotus.j2b");
        jjLocalPlayers[0].showText("@@@@@SURGE COMPLETE!", STRING::LARGE);
        for (int i = 0; i < jjLocalPlayerCount; i++) {
            jjLocalPlayers[i].limitXScroll(43, 0);
        }
        elapsed = 0;
    }
}

void onLevelReload() {
    slain = 0;
    elapsed = 0;
}

void onObjectHit(jjOBJ@ object, jjOBJ@ bullet, jjPLAYER@ player, int force) {
    if ((object.eventID == OBJECT::FLOATLIZARD || object.eventID == OBJECT::XMASFLOATLIZARD) && object.state != STATE::KILL) {
        if (player !is null) {//no TNT or turtle shells in this level, so shouldn't be necessary, but can't hurt
            if (force == 0) //normal collision, not using any buttstomps or whatever
                player.hurt();
            else {
                //Here JJ2 would check to see if the object is frozen, and if so,
                //unfreeze it and (possibly; some objects do this and others don't)
                //alter the amount of damage it receives from the bullet. There's no
                //ice ammo in this level, so that's not required.
                if (force > 0) //probably a bullet
                    object.energy -= force;
                else //special attack
                    object.energy -= 4;
                if (object.energy <= 0) {
                    if (bullet !is null) {
                        if ((bullet.var[6] & 2) == 2) { //toaster and its ilk
                            object.particlePixelExplosion(1); //burny explosion
                            jjSample(object.xPos, object.yPos, SOUND::COMMON_BURN);
                        } else {
                            object.particlePixelExplosion(0);
                        }
                        object.grantPickup(player, (bullet.eventID == OBJECT::BLASTERBULLET) ? 5 : 10);
                            //JJ2 only ever calls grantPickup for enemies/crates destroyed
                            //by bullets, but you can branch out a bit if you like
                    } else {
                        object.particlePixelExplosion(2); //killed by physical contact
                        jjSample(object.xPos, object.yPos, SOUND::COMMON_SPLAT1);
                    }
                    object.state = STATE::KILL; //let the object's behavior function take care of deleting it
                    player.score += object.points;
                    jjPARTICLE@ score = jjAddParticle(PARTICLE::STRING);     //JJ2 checks that jjGameMode is SP or COOP before doing this,
                    if (score !is null) {                    //and also makes sure that object.points is non-zero. We know both
                        score.xPos = object.xPos;            //are true here, so there's no need to bother.
                        score.yPos = object.yPos;
                        score.xSpeed = -0.5 - (jjRandom() & 0x3FFF) / 65536.;
                        score.ySpeed = -1   - (jjRandom() & 0x7FFF) / 65536.;
                        score.string.text = formatInt(object.points, "1");
                    }
                    ++slain; //the only reason we're going to all this effort
                } else //not yet dead
                    object.justHit = 5; //flash white for five ticks
            }
        }
        if (bullet !is null && (bullet.var[6] & 16) == 0) { //JJ2 also checks for var[6] & 4, aka the laser shield blast, but eh whatever
            bullet.state = STATE::EXPLODE;    //EXPLODE, like START, means the bullet won't be checked for collisions with other objects/players
                            //also, all normal bullet behaviors have code to dispose of themselves during EXPLODE, so that's nice
        }
    }
}
__________________
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Jan 11, 2015, 01:24 AM
Violet CLM is offline
Reply With Quote
Quote:
Originally Posted by Robo4900 View Post
they only spawn at the two edges of the area I've specified for them to spawn in.
You're confusing & and %

The other problems stem from your not writing obj.bulletHandling = HANDLING::DETECTBULLET; either while spawning the lizards or in their jjObjectPresets entry.
__________________
Love & Thunder Love & Thunder's Avatar

JCF Member

Joined: Sep 2011

Posts: 1,101

Love & Thunder has disabled reputation

Jan 11, 2015, 02:08 AM
Love & Thunder is offline
Reply With Quote
Ah, I thought it would be something simple like that.

Thank you very much.

EDIT:
Now having trouble adding a second wave to the surge.
I've added the following code:
Code:
} else if (slain < 30) {
    if (elapsed % 60 == 0) { //Once every just less than a second.
        uint16 randomTargetA = (237 + (jjRandom()%10)) * 32;
        jjOBJ@ obj = jjObjects[jjAddObject(OBJECT::FLOATLIZARD, randomTargetA, 1024)];
        obj.state = STATE::FALL;
        obj.var[5] = 0;
        obj.scriptedCollisions = true;
        obj.bulletHandling = HANDLING::DETECTBULLET;
    } else if (elapsed % 70 == 0) { //Once every second
        uint16 randomTarget = (237 + (jjRandom()%10)) * 32;
        jjOBJ@ obj = jjObjects[jjAddObject(OBJECT::BAT, randomTarget, 1008)];
        obj.scriptedCollisions = true;
        obj.bulletHandling = HANDLING::DETECTBULLET;
    }
} else { //slain >= 30: surge is over
But the bats spawned don't take damage.
EDIT 2: They can be killed with special attacks, but not bullets. Either way, though, they don't trigger the onObjectHit code.
EDIT 3: By removing the bullet handling part, I've fixed them being invulnerable to bullets, but they still don't activate the onObjectHit code.
EDIT 4: For debugging purposes, I've added the following code in the onObjectHit part, which should trigger every time I hit a bat:
Code:
if (object.eventID == OBJECT::BAT) {
    jjLocalPlayers[0].showText("@@@@@HIT", STRING::LARGE);
}
But it doesn't. This proves that it's not triggering the onObjectHit thing.
EDIT 5: Tried swapping the bats out for ravens. Still didn't work.
__________________

Last edited by Love & Thunder; Jan 11, 2015 at 04:16 AM.
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Jan 11, 2015, 01:22 PM
Violet CLM is offline
Reply With Quote
Try obj.playerHandling = jjObjectPresets[OBJECT::FLOATLIZARD].playerHandling;
__________________
Old Jan 11, 2015, 01:48 PM
Primpy
This message has been deleted by Stijn. Reason: non-content
KRSplatinum KRSplatinum's Avatar

JCF Member

Joined: Jul 2013

Posts: 263

KRSplatinum is a forum legendKRSplatinum is a forum legend

Jan 11, 2015, 10:18 PM
KRSplatinum is offline
Reply With Quote
Is it possible to create a level script that shows radar in-game?

Here's a good example of radar taken from Halo, the radar is in the bottom-left corner:



There's obviously precedent for finding other player's positions in the map, but I haven't seen what an HUD-based radar what look like in JJ2.
Foly Foly's Avatar

JCF Member

Joined: Jan 2009

Posts: 202

Foly has disabled reputation

Jan 12, 2015, 12:14 AM
Foly is offline
Reply With Quote
This is defininely possible. All you have to do is get some sprites, parts of tiles or whatever to draw the dots that represent players and a background. Every player has the position of all other players it's just a matter of scaling this to the dot position and making a condition for when the dots to show up. It's ofcourse also possible to put pu's, carrots and bases on it.
__________________
[13:07:13] *** Foly is on a KILLING SPREE!
[13:07:14] *** you killed yourself
[13:07:14] *** Foly was looking good but died instead...
Toni_

JCF Member

Joined: Oct 2011

Posts: 193

Toni_ is doing well so far

Jan 12, 2015, 08:25 AM
Toni_ is offline
Reply With Quote
I think you should ask Artem about that. He will explain you everything about radar and how it works.
cooba cooba's Avatar

JCF Veteran

Joined: Jan 2004

Posts: 7,812

cooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of light

Jan 12, 2015, 08:54 AM
cooba is offline
Reply With Quote
I think you should ask Artem about the 5,478 lines of code he wrote for JJ2+ instead.
XxMoNsTeRXM XxMoNsTeRXM's Avatar

JCF Member

Joined: Sep 2013

Posts: 191

XxMoNsTeRXM is doing well so far

Jan 15, 2015, 04:35 AM
XxMoNsTeRXM is offline
Reply With Quote
Quote:
Originally Posted by KRSplatinum View Post
Is it possible to create a level script that shows radar in-game?

Here's a good example of radar taken from Halo, the radar is in the bottom-left corner:



There's obviously precedent for finding other player's positions in the map, but I haven't seen what an HUD-based radar what look like in JJ2.
Well... I am trying to make a radar script.
__________________
~XxMoNsTeR
Primpy Primpy's Avatar

JCF Member

Joined: Nov 2014

Posts: 843

Primpy is an asset to this forumPrimpy is an asset to this forum

Jan 15, 2015, 11:00 AM
Primpy is offline
Reply With Quote
Quote:
Originally Posted by XxMoNsTeRXM View Post
Well... I am trying to make a radar script.
We know you can, good luck.
Apropo, majoritatea pustilor de varsta ta sunt niste pitici enervanti care se cred buricul pamantului. Ma bucur ca exista persoane inteligente ca tine in Romania!
__________________

"Floppy ears and a big butt?" - Slaz
XxMoNsTeRXM XxMoNsTeRXM's Avatar

JCF Member

Joined: Sep 2013

Posts: 191

XxMoNsTeRXM is doing well so far

Jan 22, 2015, 11:11 AM
XxMoNsTeRXM is offline
Reply With Quote
I am trying to remake "somehow" the JJ1 Bonus in JJ2 (But not 3D)

Quote:
Originally Posted by Primpy
Sounds interesting. I wish you luck!
Thanks!
__________________
~XxMoNsTeR

Last edited by XxMoNsTeRXM; Jan 23, 2015 at 12:42 AM.
Primpy Primpy's Avatar

JCF Member

Joined: Nov 2014

Posts: 843

Primpy is an asset to this forumPrimpy is an asset to this forum

Jan 23, 2015, 12:18 AM
Primpy is offline
Reply With Quote
Quote:
Originally Posted by XxMoNsTeRXM View Post
I am trying to remake "somehow" the JJ1 Bonus in JJ2 (But not 3D)
Sounds interesting. I wish you luck!
__________________

"Floppy ears and a big butt?" - Slaz
Jelly Jam Jelly Jam's Avatar

JCF Member

Joined: Oct 2014

Posts: 775

Jelly Jam is doing well so far

Jan 23, 2015, 04:56 AM
Jelly Jam is offline
Reply With Quote
Quote:
Originally Posted by XxMoNsTeRXM View Post
I am trying to remake "somehow" the JJ1 Bonus in JJ2 (But not 3D)
Does that mean the original 2d levels from JJ2 are going to be 3D, and that the 3D bonus levels will be 2D?
Just kidding, i wish you luck with this, cause it sounds really interesting
AvalancheMaster AvalancheMaster's Avatar

JCF Member

Joined: Sep 2013

Posts: 89

AvalancheMaster is doing well so far

Mar 24, 2015, 02:08 AM
AvalancheMaster is offline
Reply With Quote
It's not exactly a request but it would be if the answer is "yes".

Is it possible to combine a bridge and an Acc Belt? I'm thinking of modifying the MEZ03 serpentine belt so a custom "rolling" bridge can be made via Angelscript.
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Mar 24, 2015, 10:01 AM
Violet CLM is offline
Reply With Quote
heck, you can just put Acc Belt events in the area the bridge would take up in JCS. But more generally:
Code:
void onPlayer(jjPLAYER@ play) {
  jjOBJ@ platform = jjObjects[play.platform];
  if (playform.behavior == WHATEVER) {
    play.xSpeed CHANGES SOMEHOW;
  }
}
__________________
Love & Thunder Love & Thunder's Avatar

JCF Member

Joined: Sep 2011

Posts: 1,101

Love & Thunder has disabled reputation

Mar 25, 2015, 08:49 AM
Love & Thunder is offline
Reply With Quote
Do you think a Tails-like NPC would be hard to get working?
__________________
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Mar 25, 2015, 11:44 AM
Violet CLM is offline
Reply With Quote
The trickiest part would be writing all the logic for how to move around the level and what to react to and when to shoot and stuff. And that would be tricky. But that's because of AI, not AS.
__________________
XxMoNsTeRXM XxMoNsTeRXM's Avatar

JCF Member

Joined: Sep 2013

Posts: 191

XxMoNsTeRXM is doing well so far

Apr 7, 2015, 09:22 AM
XxMoNsTeRXM is offline
Reply With Quote
Is it possible to do #include file.j2as?
EDIT: OF COURSE I CAN Because 5.0 IS SO AWESOME!
it's just:
#include "file.j2as";
__________________
~XxMoNsTeR

Last edited by XxMoNsTeRXM; Apr 7, 2015 at 10:27 AM.
XxMoNsTeRXM XxMoNsTeRXM's Avatar

JCF Member

Joined: Sep 2013

Posts: 191

XxMoNsTeRXM is doing well so far

Apr 7, 2015, 12:05 PM
XxMoNsTeRXM is offline
Reply With Quote
ummm... it doesn't show errors in AS in 5.0
I think it's an error in the j2as I am using.
I use #include and I think maybe it can't get the error or something?
__________________
~XxMoNsTeR
cooba cooba's Avatar

JCF Veteran

Joined: Jan 2004

Posts: 7,812

cooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of light

Apr 7, 2015, 12:07 PM
cooba is offline
Reply With Quote
If you overwrote your old plus.ini with the one from the zip, you need to enable it manually again.
XxMoNsTeRXM XxMoNsTeRXM's Avatar

JCF Member

Joined: Sep 2013

Posts: 191

XxMoNsTeRXM is doing well so far

Apr 7, 2015, 12:20 PM
XxMoNsTeRXM is offline
Reply With Quote
Quote:
Originally Posted by cooba View Post
If you overwrote your old plus.ini with the one from the zip, you need to enable it manually again.
I did not do that, but AngelscriptDebug was indeed false. I set it to true and now it works. Anyway, thx!

Also I gotta learn more about the new version AS.

Ok, it says a function with the same name and parameters already exist, I know why because I use some of the JJ2+ functions in the thing that I include and in the main j2as, hmmm... I think I need help.
__________________
~XxMoNsTeR
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Apr 7, 2015, 12:38 PM
Violet CLM is offline
Reply With Quote
Quote:
Originally Posted by XxMoNsTeRXM View Post
Ok, it says a function with the same name and parameters already exist, I know why because I use some of the JJ2+ functions in the thing that I include and in the main j2as
Don't do that.
__________________
XxMoNsTeRXM XxMoNsTeRXM's Avatar

JCF Member

Joined: Sep 2013

Posts: 191

XxMoNsTeRXM is doing well so far

Apr 9, 2015, 09:20 AM
XxMoNsTeRXM is offline
Reply With Quote
Ok, I need help!
__________________
~XxMoNsTeR
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Apr 9, 2015, 10:32 AM
Violet CLM is offline
Reply With Quote
  • ANIM::PLUS_AMMO is already loaded at the start of the level, so there's no need to load it again. Especially not every single render frame, which it looks like you're doing there. Naturally if you try to load 7 new jjANIMATION entries every frame, eventually you're going to go past 1500.
  • ANIM::AMMO and ANIM::PLUS_AMMO are different. That code would mess up every animation using any of the ANIM::AMMO animations—bullets, explosions, and so on.
  • Don't use p
  • Don't use 620, 455. That won't work at other resolutions. Use jjSubscreenWidth-20, jjSubscreenHeight-25
  • I think that'll work in that case, but in general it's good to include a jjIsTSF check when writing Lori-specific code, since 1.23 doesn't always understand Lori-related constants.
__________________
Love & Thunder Love & Thunder's Avatar

JCF Member

Joined: Sep 2011

Posts: 1,101

Love & Thunder has disabled reputation

Apr 9, 2015, 06:52 PM
Love & Thunder is offline
Reply With Quote
Could someone explain how I can check if an object is using a specific set and animation?

I've tried searching the readme, but I haven't found anything.
__________________
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Apr 9, 2015, 08:18 PM
Violet CLM is offline
Reply With Quote
I suppose something like
Code:
bool doesObjectUseAnimation(jjOBJ@ obj, uint curAnim) {
  jjANIMATION@ anim = jjAnimations[curAnim];
  return obj.curFrame >= anim.firstFrame && obj.curFrame < anim.firstFrame + anim.frameCount;
}
bool doesObjectUseAnimation(jjOBJ@ obj, ANIM::Set setID, uint animID) {
  return doesObjectUseAnimation(obj, jjAnimSets[setID].firstAnim + animID);
}
__________________
Zah dud4h

JCF Member

Joined: Dec 2014

Posts: 28

Zah dud4h is doing well so far

Apr 13, 2015, 07:48 AM
Zah dud4h is offline
Reply With Quote
Is there something that makes the blue team lose if they didn't killed everyone from red team in tlrs after the game stopped?
__________________
.
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Apr 13, 2015, 10:36 AM
Violet CLM is offline
Reply With Quote
I'd try something like this (untested), if you're sure there'll be a time limit (maybe put some code in onLevelBegin to ensure that):
Code:
bool atLeastOneRedPlayerAlive() {
  for (uint i = 0; i < 32; ++i) {
    jjPLAYER@ play = jjPlayers[i];
    if (play.team == TEAM::RED && play.isInGame)
      return true;
  }
  return false;
}
void onGameStop(bool firstTime) {
  if (!jjIsServer) return;
  if (firstTime) return;
  if (jjGameState == GAME::PAUSED) return;
  if (atLeastOneRedPlayerAlive())
    //somehow indicate that you think blue lost
}
__________________
Zah dud4h

JCF Member

Joined: Dec 2014

Posts: 28

Zah dud4h is doing well so far

Apr 14, 2015, 09:23 AM
Zah dud4h is offline
Reply With Quote
Quote:
Originally Posted by Violet CLM View Post
I'd try something like this (untested), if you're sure there'll be a time limit (maybe put some code in onLevelBegin to ensure that):
Code:
bool atLeastOneRedPlayerAlive() {
  for (uint i = 0; i < 32; ++i) {
    jjPLAYER@ play = jjPlayers[i];
    if (play.team == TEAM::RED && play.isInGame)
      return true;
  }
  return false;
}
void onGameStop(bool firstTime) {
  if (!jjIsServer) return;
  if (firstTime) return;
  if (jjGameState == GAME::PAUSED) return;
  if (atLeastOneRedPlayerAlive())
    //somehow indicate that you think blue lost
}
Thanks violet,now,is there something that sets the TLRS lives depending on how many people are playing?
__________________
.
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Apr 14, 2015, 11:04 AM
Violet CLM is offline
Reply With Quote
First you figure out how many people are playing; then you do whatever math you have in mind; then you set the number of lives.
__________________
XxMoNsTeRXM XxMoNsTeRXM's Avatar

JCF Member

Joined: Sep 2013

Posts: 191

XxMoNsTeRXM is doing well so far

Apr 22, 2015, 07:07 AM
XxMoNsTeRXM is offline
Reply With Quote
I need help... I don't know much of how to use jjSTREAM, and I wanna make a custom command "!rename name" that only renames yourself, and I need to send a packet to the server to do the command "/rename clientID name".
__________________
~XxMoNsTeR

Last edited by XxMoNsTeRXM; Apr 23, 2015 at 03:26 AM.
Grytolle Grytolle's Avatar

JCF Member

Joined: Sep 2004

Posts: 4,126

Grytolle is a forum legendGrytolle is a forum legendGrytolle is a forum legend

Apr 23, 2015, 01:56 PM
Grytolle is offline
Reply With Quote
Why don't you just make rename if jjisserver in the on Chat event?
__________________
<center></center>
XxMoNsTeRXM XxMoNsTeRXM's Avatar

JCF Member

Joined: Sep 2013

Posts: 191

XxMoNsTeRXM is doing well so far

Apr 25, 2015, 03:34 AM
XxMoNsTeRXM is offline
Reply With Quote
Smile

Quote:
Originally Posted by Grytolle View Post
Why don't you just make rename if jjisserver in the on Chat event?
Ok, I learned quite more about jjStream, and now I think I know how to use it.
__________________
~XxMoNsTeR
DennisKainz DennisKainz's Avatar

JCF Member

Joined: Dec 2005

Posts: 415

DennisKainz is notorious for his worthless posts

Apr 26, 2015, 07:57 AM
DennisKainz is offline
Reply With Quote
I wanted to insert a custom sprite in my level, replacing a food with another.
1st question: How do you change the amount of set IDs and their respective frames and animation amounts in your custom j2a file? You can't do it with Jazz Sprite Dynamite.
2nd question: What should I write in Angelscript to successfully replace a food sprite with one from my custom j2a file?
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Apr 26, 2015, 10:33 AM
Violet CLM is offline
Reply With Quote
1: Don't use Jazz Sprite Dynamite.
2: Suppose for the sake of simplicity that your food sprite is in animation 0 in anim set 0 in your custom j2a file. Then there are various approaches you could take, but these two are probably the most practical.
Code:
jjAnimSets[ANIM::CUSTOM[0]].load(0, "myCustom.j2a");
//option 1: affects only apples
jjObjectPresets[OBJECT::APPLE].determineCurAnim(ANIM::CUSTOM[0], 0);
//option 2: affects any object that might try to use the apple animation
jjAnimations[jjObjectPresets[OBJECT::APPLE].curAnim] = jjAnimations[jjAnimSets[ANIM::CUSTOM[0]]];
__________________
DennisKainz DennisKainz's Avatar

JCF Member

Joined: Dec 2005

Posts: 415

DennisKainz is notorious for his worthless posts

Apr 28, 2015, 06:04 AM
DennisKainz is offline
Reply With Quote
Thank you for the help! I now can make those custom objects I've been trying to make for years! (see "Campaign Mysteries" and other archaic levelpacks of mine)

I'm now experimenting the tile redrawing functions of AngelScript. Is there by chance an option that allows you to not only draw a tile on a specified layer, but also repeat it along with the JCS Tile Width / Height function? (as far as it is in the screen, ofcourse, otherwise it would cause a hyperlag)
Reply

Tags
angelscript, code, jcs, request

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT -8. The time now is 10:17 AM.