JazzJackrabbit Community Forums

JazzJackrabbit Community Forums (http://www.jazz2online.com/jcf/index.php)
-   General Jazz Jackrabbit Talk (http://www.jazz2online.com/jcf/forumdisplay.php?f=4)
-   -   JJ2+ v6.6h (last updated 1 September, 2026) (http://www.jazz2online.com/jcf/showthread.php?t=19489)

Violet CLM Jan 29, 2013 03:43 PM

Quote:

Originally Posted by Sir Ementaler (Post 477823)
Afaik this is an old bug that used to happen to all levels run by Save & Run, until one of older JJ2+ releases fixed it. I checked it and it doesn't seem to have returned with this release though.

Edit: Ah, however, at least according to Trey, it occurs in plusEnscripted.j2l if you use Save & Run, so possibly also some other but not all levels.

IIRC this is a matter of filename length, like if the .j2l filename is too long it ends up bleeding into another string? Something like that. It's an old, old bug.

EDIT: Can those who are experiencing troubles with TNT not destroying destruct scenery share their plus.ini settings for ExtendedTNT and TNTDamage? I don't know if that's related to the problem, but it seems the most sensible place to start looking.

EDIT2: We're on Mod DB!

Seren Jan 29, 2013 05:12 PM

Oh. That would make sense. I assume it might have never been fixed then and I just coincidentally started using short level names around the time of the last Plus release.

Crazy Rabbit Jan 30, 2013 12:19 AM

AngelScript really gave a lot of new features. My big big thumbs up and full C for the new JJ2+!

DanZeal Jan 30, 2013 03:34 AM

Thank you for -servername !

cooba Jan 30, 2013 05:59 AM

Please remove /bestpony, the last thing JJ2 needs is this crap.

Jerrythabest Jan 30, 2013 06:04 AM

/bestpony The one KEEPING IT!

Foly Jan 30, 2013 08:32 AM

/bestpony |c|o|o|b|a

Anyway, i got a question about AngelScript:
I want to convert an integer to a string, do i need to write my own function for this or is there already a function to do this? I've searched the internet and i did found some functions, but they didn't work so i guess they aren't implanted here.

Violet CLM Jan 30, 2013 11:26 AM

Right now you have to write your own function, yes. It was mentioned once or twice as an idea but ended up falling through the cracks. Sorry.

Jerrythabest Jan 30, 2013 11:36 AM

I think we could use more of those general-use functions in the API.

minmay Jan 30, 2013 04:02 PM

Are there still plans for a "JCS+" or has that been superseded by WebJCS?

GoldRabbit Jan 30, 2013 04:18 PM

A suggestion (that I also made on the server) should be that if a level using angelscript needs multiple music tracks, they all should be downloaded along with the level and j2as.

Love & Thunder Jan 30, 2013 05:46 PM

I found a bug in plusJCSFun: If you die, the timer at the beginning of the level doesn't restart, so it is impossible to progress in the level. I did find a way to get the timer to start again, though: type JJK until you reach the "Continue?" screen, and select "Yes".

Jerrythabest Jan 31, 2013 02:33 AM

That's probably a j2as bug specific for the level. I figure it isn't hard to fix, but the priority is close to 0 :p


About the downloading music stuff, this is a known issue. The same applies to palettes/tilesets (AngelScript allows you to load the palette from a different tileset). This is a rather difficult thing to fix since it's close to impossible to know which files are needed beforehand, but I guess eventually a 'download on demand' feature could solve this. But it's not easy to make such a thing (and we need to make it secure).

burnout92 Jan 31, 2013 02:59 AM

This patch will works with TSF?

Foly Jan 31, 2013 03:11 AM

Quote:

Originally Posted by burnout92 (Post 477856)
This patch will works with TSF?

Yes it does.

burnout92 Jan 31, 2013 03:31 AM

Quote:

Originally Posted by Foly (Post 477857)
Yes it does.

That's great!

Crazy Rabbit Jan 31, 2013 04:26 AM

Shall AngelScript support custom sounds and sprites in future updates of JJ2+?

Jerrythabest Jan 31, 2013 04:43 AM

We've come up with that idea during development too, but it suffers from the same problem as I explained in the previous post: it's virtually impossible to let clients download such script-dependent files. So it would only work if both the server and all clients already have the respective sounds and sprites in their Jazz folder.

Theoretically, this would be possible in offline games. But it would probably take so much time to get working correctly that we'd rather spend that time on more broadly applicable features.

As can be seen in, for example, plusSurvivor, you can use existing sprites and sounds to create new objects in your levels. And as can be seen in plusEnscripted, it's possible to react according to any STATE that an object may be in by writing code for it. This way, it is in fact possible to script your own enemies or other special objects. Hell, if you've got way too much spare time you could even write a complete AI that uses the Jazz/Spaz/Lori sprites and have that running around in the level and shooting at players passing by. It's possible if you're willing to write a seriously huge script for it.

Violet CLM Jan 31, 2013 09:33 AM

Quote:

Originally Posted by Jerrythabest (Post 477855)
This is a rather difficult thing to fix since it's close to impossible to know which files are needed beforehand, but I guess eventually a 'download on demand' feature could solve this.

It's not all that hard if you're willing to put a little extra burden on the level designer and have them manually create a jjRequiredFilenames list or something. AS wouldn't need to know whether a given file was music, or sprites, or a palette, or what, just that it was required for the level. The only problem is that we don't have any code to work from for sending variable numbers of files to a client -- right now servers will send at most one .j2l, at most one .j2t, at most one .j2as, and at most one (skippable) music file. Adding a non-constant number of extra files would be a bit trickier, and the thing is, tools to make custom sprites for JJ2 don't even exist right now, so why bother?

FawFul Jan 31, 2013 12:18 PM

Quote:

Originally Posted by Violet CLM (Post 477861)
It's not all that hard if you're willing to put a little extra burden on the level designer and have them manually create a jjRequiredFilenames list or something. AS wouldn't need to know whether a given file was music, or sprites, or a palette, or what, just that it was required for the level. The only problem is that we don't have any code to work from for sending variable numbers of files to a client -- right now servers will send at most one .j2l, at most one .j2t, at most one .j2as, and at most one (skippable) music file. Adding a non-constant number of extra files would be a bit trickier, and the thing is, tools to make custom sprites for JJ2 don't even exist right now, so why bother?

Well maybe not custom, but it is already possible to change current sprites: There is Jazz Sprite dynamite. that edits sprites in the Anims.j2a file. It's a bit hard to use but works perfectly. I think what zoro maybe means is to copy the Anims.j2a file from a server.

Proof of 2 quite changeable examples:
http://www.jazz2online.com/downloads/6648/sonic-jj2/
and
http://www.mediafire.com/?rdkiwihcxyd6yc0

Jerrythabest Jan 31, 2013 01:04 PM

I figure if we truly were to implement this, the easiest solution would be to use some already-existing file format like GIF. Plenty of tools can make those, they are indexed (i.e. use a 256-color palette), they are small, their file format is easy (not to mention there's probably a free library for loading them) and they may include multiple images in one file.

Violet CLM Jan 31, 2013 01:05 PM

Granted. The thing is, you'd never want to transfer an entire anims.j2a file for an individual level. It's enormous, and 90% of it would be redundant. You'd want smaller custom .j2a files with only the new sprites contained in them.

Partially ninja'd by Jerry... keep in mind that sprites contain more information than the raw frame images.

Jerrythabest Jan 31, 2013 01:20 PM

In that case I figure we could either search or make a simple tool to enter "Comment Extension" blocks into the GIF file. See Chapter 24 on page 17.

Code:

struct CommentExtension{
    char extensionIntroducer = 0x21;
    char commentLabel = 0xFE;
    char dataSize;
    char[dataSize] data;
    char blockTerminator = 0x00;
}

Then we can just define the extra information in the comment data. (Reading the thing myself the second time, this would void the spec since it "should not be used to store control information for custom processing". The Application Extension block is an alternative.)

Slaz Feb 1, 2013 08:43 AM

Could any of you dev's try to find a way to disable 'double buffering' with DirectDraw for the next Plus release? You know, the Windows 8 issue that's still going on.

While triple buffering can be turned off in JJ2 using the -notriple flag, double buffering appears to be hardcoded..

I hope Microsoft will come up with a DDraw fix someday, but until then, all old DDraw based games have to be played single buffer to prevent severe performance loss!

DarkShadow Feb 1, 2013 10:07 AM

I approve.

It's cool seeing the continued work and activity. Great work! :)

minmay Feb 1, 2013 03:03 PM

Would it be easy to add the capability to set the position of a layer with an auto speed? Right now, to change a layer's auto speed without an abrupt "jump" you have to wait until certain render frames, and the gap between those frames is often several seconds.

That's a real question, not just a feature request, I honestly have no idea how this is handled internally (as you can see in mingfpack19.j2l).

Example: I'm remaking the first level of Episodic Ground Force Pack Episode 1, and I want the deadly clouds at the top to slowly move downwards when Sudden Death activates. If I just set the layer's auto Y speed to -1, they will appear to jump across (or off) the level, which is obviously not what I want.
I'm aware that this breaks if someone pauses, fortunately you can't do that in multiplayer anymore in the latest Plus...right?

Setting a pixel offest for each layer would also work, of course, and a lot more versatile, but it might be too slow to call that every frame?

djazz Feb 1, 2013 03:47 PM

Awesome! So much stuff to play with.. :D
Works great on Linux too :)


In the JJ2+ readme: jumpSpeed is misspelled.. should be jumpStrength.


Some AngelScript questions...
  • (SOLVED) Is there a way to change how fast a player can run (speed)? I can change how high the player can jump (sortof with jumpStrength, you can still run and reach higher).
    Edit: This code seem to work:
    Code:

    void limitSpeed(float speed) {
            if (p.xSpeed > speed) {
                    p.xSpeed = speed;
            } else if (p.xSpeed < -speed) {
                    p.xSpeed = -speed;
            }
    }

  • I tried to run a command using jjChat() in the onLevelLoad (as server), and it says "Error: Commands cannot be used while level is cycling".
  • Can I store custom variables for players? Or must I make my own array with player-info/objects?
  • Can I make the blaster have a limited set of ammo, like the other weapons?
  • I want to make a player fire the laser beam (with a recharge delay) without shield, possible? Think Quake3-style, or any game with a sniper.
  • Can I use fireball as one player and pepper spray as another player in the same server?
  • Can I limit the rate the player is allowed to fire a bullet (not faster than current fastfire delay, for example), no matter how fast the player is smashing the fire-key?
  • I want ice/tnt to heal teammates only, how can I do that with AS? I can to that with negative TNT damage and friendlyfire, but that also heals nearby teammates.
  • Can I disable a special move, like uppercut/superjump?
  • (SOLVED) I want some players to have different max-healths, in a class-based gamemode I'm making (TF2).
    Edit: I call this function from a switch-statement in the onPlayer-function, with the desired maxHealth:
    Code:

    void limitHealth(int maxHealth) {
            if (p.health > maxHealth) {
                    p.health = maxHealth;
            }
    }

  • Can i make the TNT delay longer?

Scripting JJ2 is awesome! :D

Violet CLM Feb 1, 2013 04:40 PM

minmay: Planned, but not yet implemented. We ran into some trouble with layer drawing code and haven't resolved it so far.

Quote:

Originally Posted by DJazz (Post 477891)
Works great on Linux too

Yeah, I think I figured out what your problem was before.
Quote:

I tried to run a command using jjChat() in the onLevelLoad (as server), and it says "Error: Commands cannot be used while level is cycling".
I'm... not sure what you want me to say here. The error is a true statement.
Quote:

Can I store custom variables for players? Or must I make my own array with player-info/objects?
The latter, I reckon.
Quote:

Can I make the blaster have a limited set of ammo, like the other weapons?
Probably. Do something like void onPlayer() { p.score = p.ammo[1]; } and you'll see that blaster does in fact have an ammo count, it's just that it gets reset to 100 every time it hits 0. You can hack something together from there, though it'll still display as infinity.
Quote:

I want to make a player fire the laser beam (with a recharge delay) without shield, possible? Think Quake3-style, or any game with a sniper.
Something like jjObjects[jjAddObject(OBJECT::LASER, p.xPos, p.yPos, p.playerID, CREATOR::PLAYER)].direction = p.direction; should work, though it won't show up online.
Quote:

Can I use fireball as one player and pepper spray as another player in the same server?
No.
Quote:

Can I limit the rate the player is allowed to fire a bullet (not faster than current fastfire delay, for example), no matter how fast the player is smashing the fire-key?
You could try turning noFire on and off a lot, I guess? You'd have to hack together a bullet-was-fired detection by comparing ammo count or something, though; this isn't something we have basic support for yet.
Quote:

I want ice/tnt to heal teammates only, how can I do that with AS? I can to that with negative TNT damage and friendlyfire, but that also heals nearby teammates.
Not AS-related, nor otherwise supported AFAIK.
Quote:

Can I disable a special move, like uppercut/superjump?
Not yet.
Quote:

I want some players to have different max-healths, in a class-based gamemode I'm making (TF2).
if (p.health > #) p.health = #;
Quote:

Can i make the TNT delay longer?
Almost certainly. Just find the right jjOBJ and then find the right property to edit.

burnout92 Feb 2, 2013 12:19 AM

Why not support the TSF: LK Avalon release of this patch? Because I wanted him to try the patch, because I have the normal TSF: LK Avalon release was bored. Can we solve the problem in some way?

cooba Feb 2, 2013 02:41 AM

Quote:

Originally Posted by Violet CLM (Post 477894)
Quote:

Originally Posted by DJazz (Post 477891)
I tried to run a command using jjChat() in the onLevelLoad (as server), and it says "Error: Commands cannot be used while level is cycling".

I'm... not sure what you want me to say here. The error is a true statement.

Can't believe I haven't thought of this before, but something like onFirstTick() would be ideal for this purpose (and other purposes).

Toni_ Feb 2, 2013 05:10 AM

Quote:

I want some players to have different max-healths, in a class-based gamemode I'm making (TF2).
First do:
/starthealth 1
/maxhealth 7,
then, for every class, put a warp after start pos, to sucker tube, where you place some +1 carrots. Depends of how much health do you want class to have.

Jgke Feb 2, 2013 05:20 AM

Quote:

Originally Posted by Just a Random User (Post 477902)
First do:
/starthealth 1
/maxhealth 7,
then, for every class, put a warp after start pos, to sucker tube, where you place some +1 carrots. Depends of how much health do you want class to have.

What if there would be carrots in the level? How can you determine how much exactly can a player heal? ;)

Stijn Feb 2, 2013 05:24 AM

Have one local trigger per class, read status of trigger to determine max health for the player.

Seren Feb 2, 2013 06:08 AM

Guys, Violet already answered that question and Djazz adjusted his script accordingly. :p
The only thing that could be improved is changing carrots into some other object temporarily so that they can't be taken when a player is on full health. That is also possible and not too difficult to script afaict.

cooba Feb 2, 2013 06:31 AM

Question: is it possible to manually bring back/STATE::KILL an object that is STATE::DEACTIVATE?

EDIT: Found a workaround for what I want to do, but the above would still be cool to have somehow.

Jerrythabest Feb 2, 2013 12:26 PM

Quote:

Originally Posted by cooba (Post 477898)
Can't believe I haven't thought of this before, but something like onFirstTick() would be ideal for this purpose (and other purposes).

In fact, it's used in plusSurvivor.j2as.

plusSurvivor uses the following:
Code:

bool isLoaded = false;
void onMain(){
    if(!isLoaded){
        isLoaded = true;
        //jjChat your commands here
    }
}

But I figure this shorter version would work equally well:
Code:

void onMain(){
    if (jjGameTicks == 0){
        //jjChat your commands here
    }
}


Quote:

Originally Posted by DJazz (Post 477891)
Can I disable a special move, like uppercut/superjump?

You can disable Spazz's doublejump with
Code:

void onPlayer(){
    p.alreadyDoubleJumped = true;
}

I wonder whether Players have a STATE just like other objects. In that case, access to that could be really powerful.

GLaDOS Feb 2, 2013 02:23 PM

Amazing update! Great job Violet, Jerry and all the others who contributed to this new version. I am really enjoying the functionality AngelScript adds and looking forward to possibilities that future extensions to the scripting API will bring.

I am aware of this being the first iteration of J2AS, though I do have a few suggestions to make:
If players lack the same kind of "STATE" field that objects have, the ability to access player animations could be useful for detecting these states, as a sort of workaround.
Also, being able to use the numpad for switching weapons would be very useful, not only for alternate key configurations, but also as a sort of 8-directional input to be used with scripting.
Finally, functions to send/receive custom UDP packets from scripts would allow for proper server/client synchronization without having to use hacks such as positions or bullets to encode data to be sent to the server, but I guess this could turn to be somewhat complicated to implement properly. If that is the case, please do not consider this too much of a top priority request and focus on the more important stuff first (mainly bugfixes).

Anyway, keep up the great work!

Jerrythabest Feb 3, 2013 01:40 AM

Well, I'd consider the lack of packet functions in AngelScript a major factor. The only reason it's not in there right now is because it's really difficult to pull off. But it must happen someday!

cooba Feb 3, 2013 04:00 AM

Quote:

Originally Posted by Jerrythabest (Post 477911)
But I figure this shorter version would work equally well:
Code:

void onMain(){
    if (jjGameTicks == 0){
        //jjChat your commands here
    }
}


jjGameTicks needs to equal 1, not 0, but otherwise this works perfectly.

FawFul Feb 3, 2013 04:32 AM

Not sure if mentioned already, but i tried Sir elementalers Day/Night script today and i couldn't last in jj2 for longer than 2 minute. fps dropped to 3 at a certain point with shortly an access violation after. Now i wanted to know what was going on, and apparently jj2 eats more and more memory over time. You start of with like 10mb memory usage for jj2. and in less than 2 minute that turns into 600mb and it just keeps raising till it's too much to handle probably. I think this memory usage raising is a major bug and should be fixed as soon as possible. With this script it actually raised around 8mb per second..


All times are GMT -8. The time now is 04:47 AM.

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