Jul 23, 2016, 11:23 PM | |
I'm having trouble thinking of a sprite mode combination that would manage to draw all sprites in a single color but leave the background a different (translucent!) color, but I guess you could just do what PlusOJ does and grayscale the whole area:
Code:
jjDrawRectangle(TopLeft, TopRight, Width, Height, 0, SPRITE::BLEND_SATURATION, 255, 2); |
Jul 24, 2016, 01:27 AM | |
I know this is not an AngelScript functionality request thread, neither is this idea on the top of your priorities list, but would something like this be possible to implement:
SPRITE::TWOTONE, uint8, uint8 Where the first integer selects a color from the palette for the background (e.g. white), and the second integer selects a color from the palette for all the sprites and masked areas? |
Jul 24, 2016, 09:45 AM | |
Not really within the current framework, no.
|
Aug 21, 2016, 01:21 AM | |
Hi, I hope this is still running, I've got 2 questions;
1) I assume it's not possible to trick drawString into drawing text with multiple lines? (unless I make more drawString's each one for each line) 2) What's some fancy way to prevent player from moving? I know every frame I can set his xPos and yPos, but it doesn't look too good - how do I make him standing still (even when he's pressing arrows)? |
Aug 21, 2016, 01:34 AM | |
3) I haven't yet quite figured out jjParameterGet, this code should tell me, how many of each gem is in the crate:
Code:
jjAlert("----------------------------------"); jjAlert(formatInt(jjParameterGet(26,19,4,0),"1")); jjAlert(formatInt(jjParameterGet(26,19,4,4),"1")); jjAlert(formatInt(jjParameterGet(26,19,4,8),"1")); jjAlert(formatInt(jjParameterGet(26,19,4,12),"1")); jjAlert("----------------------------------"); It also doesn't seem to work properly on "Area ID", not giving area's ID. EDIT: Meh, question 3 solved. sorry for spam Last edited by MilloCz; Aug 21, 2016 at 01:45 AM. |
Aug 21, 2016, 06:41 AM | |||
Quote:
jjTEXTAPPEARANCE . Properties of your interest are at and newline . See also the table in the constructor, showing that you can in fact avoid jjTEXTAPPEARANCE usage altogether if your case allows using STRING::SPIN . There is currently no way to customize vertical spacing of text.Quote:
onPlayerInput .
__________________
I am an official JJ2+ programmer and this has been an official JJ2+ statement. |
Aug 25, 2016, 08:44 AM | |
Thanks for reply, I will check that out.
Also, could you help me with cameraFreeze? when you are near x position 0, camera freezes and doesn't move out of level border - can I do this with cameraFreeze on other positions too? My code: Code:
if(p.xPos>260*32){ if(did_he_set_it == 0){ playerx = p.xPos; did_he_set_it = 1; } p.cameraFreeze(playerx ,p.yPos, true, true); } else{ p.cameraUnfreeze(true); did_he_set_it = 0; } |
Aug 28, 2016, 02:15 PM | |
Also, please, mind helping me with classes? I am not programmer and I have actually very poor knowledge at programming. I have trouble making classes work. Why is this not working?
Code:
class Character { string name = "default"; Character(){} } Character Guy; Guy.name = "Peter"; |
Aug 28, 2016, 02:43 PM | |
That's not a class problem so much as the fact you can't run non-initialization code outside of functions like that. Either of these would work:
Code:
class Character { string name = "default"; Character(){} } Character Guy; void onLevelLoad() { Guy.name = "Peter"; } Code:
class Character { string name = "default"; Character(){} Character(string newName) { name = newName; } } Character Guy("Peter"); |
Feb 2, 2017, 07:05 AM | |
SpriteSheet question
Hi everyone, I already know some simple code to adjust things in single player such as fur color and adding hearts etc, but one thing I have been thinking about is the example I found where one could play as Mario. Is there any code out there (a simple would be awesome since Im not pro on programming haha xD) that I can use to for example play as Mario instead of jazz in any single player level? Actually I just want to be able to play as any other character from a spritesheet rather than the one's already exist. Thanks alot for reading my question and if you in any way don't like anything about my question, maybe it's not written correctly or I go against any rule, I will learn from this and never do such thing again. Thanks alot !
|
Feb 2, 2017, 10:44 AM | |
You're talking about Play as Mario. That's a mutator, which means it can run in any level, including single player levels, though unfortunately there's not a good built-in interface for making that happen right now. What you can do though is create a dummy level, let's say marioifier.j2l, and then write the following marioifier.j2as script:
Code:
void onLevelBegin() { jjChat("/mutators mario on"); jjNxt("diam1.j2l", true, true); } That's not a great solution, but until we make some more code changes it's probably the best you'll get. :# As for other characters from other spritesheets, pretty much the exact same code would be involved, based on my snippet--the hard part is assembling the custom .j2a with the full roster of player sprites. |
Feb 2, 2017, 03:58 PM | |
Thanks alot for your reply Violet! I will attempt to do that! Yes that's the one I ment, though I forgot it wasn't among the snippets section but in the level section, I should have linked it to my post ofcourse sorry for this haha xD thanks!
|
Feb 3, 2017, 04:21 AM | |
Wow! It did work out to play as mario on that level by activating the .mut to on It's really cool! Do you mind me asking one thing though, when you say "the hard part is assembling the custom -j2a with the full roaster of player sprites" do you mean that it's a bit difficult to put a sprite sheet together to make it work properly so that every picture works as one animation and having the exact required length between two pictures? By length I mean that if one animation is when the right leg is forward, and one animation is the left leg forward and that those two animation pictures doesn't "merge" into one so that you see both pictures at once? If this is the case, would it be possible to find a spritesheet that does work properly and kind of remake each picture with my own picture? Sorry if this is bad written I can rewrite it better if you want Thanks, btw I also saw this one - https://www.jazz2online.com/downloads/6648/sonic-jj2/ but the file extension .j2a is where the code for sonic animation is right?
|
Feb 3, 2017, 04:25 AM | |
By the way I forgot to say, I saw your example of .j2a, do you possibly have a spritesheet that fits into that example so that I could understand this part? Thanks again
EDIT: I will edit my post a bit because I found this thread: https://www.jazz2online.com/jcf/showthread.php?t=19856 Should I follow this in order to complete my question? Last edited by Tonycake; Feb 3, 2017 at 05:00 AM. |
Feb 3, 2017, 09:58 AM | |
So, we don't have a tool that either imports .j2a files from sprite sheets or exports .j2a files to sprite sheets. That's one of the logical options, along with using animated gifs, but the only tool we have—which you found and linked to—works with a bunch of single .png images spread across various folders. Here, for example, is how one of Spaz's animations is represented (as viewed in Windows Explorer):
It's absolutely possible to use that tool to create a new set of sprites—the Mario mutator did exactly that. I'm just saying it takes a while to do, particularly because player characters have over 75 distinct animations. Not only do you have to find all the sprites, you have to spend time getting them into the right format so JJ2 can understand which ones to draw at what times and where. If you are interested, I'd suggest starting with something simpler like replacing the sprites for a single enemy first, so you can be sure you know how the process works before you start doing it over and over. (The Sonic one is a similar concept but replaces your entire default anims.j2a file, because that was the only option available at the time it was made, rather than replacing only individual animations or animation sets like is allowed by JJ2+.) |
Feb 5, 2017, 06:18 AM | |
I'd really prefer if AngelScript would be deprecated in favor of Lua. Lua is much more mainstream scripting language, has easier to learn syntax and is faster (as in execution speed). Which means more people would be able to code their own stuff as Lua is used across the gaming/modding industry as the go-to scripting backend.
Lua is used in games such as: - SMBX - Gmod - Prison Architect - And many, many more (few are surprises on that list) Of course AngelScript backend should remain in place, but only for the sake of compatibility with the older levels. If news would go into the wild about JJ2 now supporting Lua, I'm sure this will bring more modders into it and maybe revitalize dying JJ2 level scene (yes, I call levels released by the same people over and over again, with no "new blood" dying).
__________________
Code:
.──. │O_O │ ││_╱ │ ╱╱ │╲ (|▔╲ │ ) ╱'╲_▔ _╱`╲ ╲___) (___╱ TUX LOVES YOU. |
Feb 5, 2017, 08:27 AM | |
Hi once again!
It works very good with the python file I downloaded to extract images and import them, I tried remake some of the mario.j2a and it worked which made me very happy! Since alot of images have a background 0,0,0 the "colorkey" must be set to make that transparent or something I guess because of all zeros at the pictures (don't take this serious because it's just a guess im actually a begginner xD) anyway, I might have missed something obvious and I read about the Anims.j2a including sound files and that you should not try this method with that one. But if I want to replace the heart symbol (lives), and would change this picture to something else, how would I import the Anims.j2a folder when im done? I mean I read this snippet https://www.jazz2online.com/snippets...zs-animations/ is this the way to go? It says animation and im not sure if it means ONLY character animations or pictures aswell, if I missed something obvious im sorry for this, I will try to find the answer on internet or here meanwhile waiting for someone to tell me, thanks alot for every help I have recieved im glad! EDIT: forget the 0,0,0 theory the numbers were explained in the first post how can I miss this 2nd EDIT: I forgot to mention, I understand the difference between the sonic.j2a and mario.j2a, I opened both of them so now I understand this clearer 3rd EDIT: I also thought that since you don't write "ANIM::LIVES" or something similar like you do "ANIM::JAZZ", my guess is the sonic way is the way to go since it alter the whole folder like Violet told me earlier, because the snippet Violet made "Replace Jazz's Animation" alter the main character that you play as right? Thanks, when I understood this I will stop asking so much haha xD thanks 4th EDIT: https://www.jazz2online.com/download...p?levelID=4041 must be it right ABSOLUTELY LAST EDIT: I can edit Anims.j2a now with that program ! Im very happy for this thanks alot for every help and if someone else wants help with editing stuff in jazz jackrabbit 2 + send me a message and I help you! Thanks alot Last edited by Tonycake; Feb 5, 2017 at 01:16 PM. |
Feb 5, 2017, 01:36 PM | |
It looks like you made a lot of progress! Two clarificatory notes:
* When building a tileset, it's important that the first color in the palette be 0,0,0, but .j2a files do not care about that. You can use whatever palette you like. * Jazz Sprite Dynamite can be used to edit anims.j2a, yes, but I wouldn't suggest doing that unless maybe if you truly intend to change a significant percent of the sprites in the game. Anims.j2a is an enormous file, in part because it includes almost all the game's sound effects, and it was not made to be distributed. Smaller, specific case .j2a files are to be preferred. The reason there's no ANIM::LIVES is because unlike Jazz or Spaz, there's only a single animation for the 1up pickup, so it doesn't need its own animset. It's in the ANIM::PICKUPS set instead. In fact, the 1up pickup is literally the subject of the examples provided in the jjANIMSET documentation. So, assuming you've loaded an animation that you want to use for 1up pickups from a custom .j2a set, you'll want to write something like Code:
jjObjectPresets[OBJECT::EXTRALIFE].curAnim = myAnimationID; Code:
jjAnimations[jjObjectPresets[OBJECT::EXTRALIFE].curAnim] = jjAnimations[myAnimationID]; Code:
jjAnimations[jjAnimSets[ANIM::PICKUPS].firstAnim] = jjAnimations[myAnimationID]; |
Feb 7, 2017, 11:43 AM |
Violet CLM |
This message has been deleted by Stijn.
|
May 22, 2017, 01:28 PM | |
Quite new to scripting and sorry if I miss something completely obvious, but take a look: http://imgur.com/a/ohkoE
How do i make this look like the far right side of the level without changing the width of my level in JCS? And since I'm planning to make something on the other side of the wall as well, how do i make it look like the far LEFT side of the level? Can i make it happen ingame by touching a text area? (not entirely to the left or right though, 2 or 3 vertical rows of tiles could be visible) EDIT: oh and i meant to say that i want to make it look like the far left just a bit later, that's why i mentioned the text area. |
May 22, 2017, 07:18 PM | |
If I understand you right, you're looking for
jjPLAYER::limitXScroll . Or depending on circumstances you might not even need angelscript, just the Limit X Scroll event.
|
May 24, 2017, 08:46 AM | |
Well that worked!
Is there a way to change the player name color? Especialy without messing it all up if the player already has his/her name colored, thus changing into some other color. Can it be done even in CTF and its custom gamemodes? Without swapping teams, of course. |
Aug 15, 2017, 02:16 PM | |
Thread revival!
I'm trying to make an enemy that periodically surrounds itself with a ring of hourglasses. The solution I came up with was to edit the Pizza event so that it's a gem ring with the event ID set to 90. The enemy would then spawn a pizza and constantly set its xPos and yPos to its own. However, I'm having trouble figuring out how to access the Gem Ring event value in the script. Here's what I have so far: Code:
void onLevelLoad() { jjObjectPresets[OBJECT::PIZZA].behavior = freezeRing; } void freezeRing(jjOBJ@ obj) { obj.behavior = BEHAVIOR::GEMRING; obj.eventID = 90; obj.var[2] = 90; obj.var[0] = 4; obj.var[1] = 4; }
__________________
"So unless I overwrote my heart with yours, I think not. But I might have." - Violet CLM Two Games Joined releases: Control / Splinter (twin singles) || Ballistic Bunny (EP) || Beyond (maxi-single) || Beyond: Remixed (remix EP) || Inner Monsters OST (mini-album) || Shadows (album) |
Aug 15, 2017, 09:55 PM | |
My instinct would be to create an OBJECT::GEMRING on top of an event that you know has the right parameters to produce a gem ring with hourglasses, rather than using a pizza.
|
Aug 16, 2017, 05:07 AM | |
Okay, that does indeed work when I spawn the event at onLevelLoad. I can't make the enemy spawn it, however, though on paper this looks like it should work:
Code:
void onLevelLoad() { jjObjectPresets[OBJECT::BEE].behavior = testBee; } void testBee(jjOBJ@ bee) { int freeze; bee.behave(BEHAVIOR::BEE); if (bee.state == STATE::START) { freeze = jjAddObject(192, 50, 50, 0, CREATOR::OBJECT); } if (bee.state == STATE::FLY) { jjObjects[freeze].xPos = bee.xPos; jjObjects[freeze].yPos = bee.yPos; } if (bee.state == STATE::KILL) { jjObjects[freeze].state = STATE::KILL; } }
__________________
"So unless I overwrote my heart with yours, I think not. But I might have." - Violet CLM Two Games Joined releases: Control / Splinter (twin singles) || Ballistic Bunny (EP) || Beyond (maxi-single) || Beyond: Remixed (remix EP) || Inner Monsters OST (mini-album) || Shadows (album) |
Aug 16, 2017, 09:01 AM | |
Three thoughts...
|
Aug 16, 2017, 10:27 AM | |
Great, it works! I don't really need #3 since this is going to be a boss fight, so the gem ring spawn point will always be nearby. Right now the last thing I'm trying to figure out is creating a new hourglass shield a while after the current one is destroyed by touching it. I can't really find what's wrong in the code, but for some reason it makes the bee create new rings regardless if it already has one or not:
Code:
void testBee(jjOBJ@ bee) { if (bee.state == STATE::START || bee.counter == 255) { bee.counter = 0; bee.special = jjAddObject(192, 50, 50, 0, CREATOR::OBJECT); } bee.behave(BEHAVIOR::BEE); if (bee.state == STATE::ATTACK || bee.state == STATE::FLY || bee.state == STATE::IDLE) { jjObjects[bee.special].xPos = bee.xPos; jjObjects[bee.special].yPos = bee.yPos; if (jjObjects[bee.special].state == STATE::KILL) { bee.counter++; } } if (bee.state == STATE::KILL) { jjObjects[bee.special].behavior = BEHAVIOR::EXPLOSION2; } }
__________________
"So unless I overwrote my heart with yours, I think not. But I might have." - Violet CLM Two Games Joined releases: Control / Splinter (twin singles) || Ballistic Bunny (EP) || Beyond (maxi-single) || Beyond: Remixed (remix EP) || Inner Monsters OST (mini-album) || Shadows (album) |
Aug 16, 2017, 11:54 AM | |
Well, there are a couple issues, but the one you're facing at the moment is that
BEHAVIOR::BEE also increments jjOBJ::counter .
|
Dec 1, 2017, 12:25 PM | |
Is there a way to keep custom data between levels? I'm thinking about making a central hub level where you can unlock paths and stuff by doing certain stuff in other levels and for that I need a way to keep some information when player moves between levels.
If that's not possible, treat it as a request.
__________________
Code:
.──. │O_O │ ││_╱ │ ╱╱ │╲ (|▔╲ │ ) ╱'╲_▔ _╱`╲ ╲___) (___╱ TUX LOVES YOU. |
Dec 1, 2017, 05:36 PM | |
The most intuitive way is to save the data to disk using jjSTREAM, which is effectively what JJ2 does when you enter a secret level like Gargoyle's Lair. Alternatively you can abuse JJ2 a little by storing values in the properties of higher-numbered players that never get erased, like
jjPlayers[31].score or whatever.
|
Dec 1, 2017, 05:57 PM | ||
Quote:
Code:
void onLevelLoad() { for (int eventID = OBJECT::BLASTERBULLET; eventID <= OBJECT::ELECTROBULLETPU; ++eventID) { jjObjectPresets[eventID].lightType = LIGHT::NONE; } } void onPlayer(jjPLAYER@ play) { play.lightType = LIGHT::NONE; } |
Dec 1, 2017, 08:47 PM | ||
Quote:
__________________
"So unless I overwrote my heart with yours, I think not. But I might have." - Violet CLM Two Games Joined releases: Control / Splinter (twin singles) || Ballistic Bunny (EP) || Beyond (maxi-single) || Beyond: Remixed (remix EP) || Inner Monsters OST (mini-album) || Shadows (album) |
Dec 2, 2017, 08:25 AM | |
I see. Though I think ability to use disk I/O in AngelScript would solve the issue. And I want it to be a single playthrough deal anyway.
__________________
Code:
.──. │O_O │ ││_╱ │ ╱╱ │╲ (|▔╲ │ ) ╱'╲_▔ _╱`╲ ╲___) (___╱ TUX LOVES YOU. |
Dec 8, 2017, 01:48 AM | |
Hey there,
I've imported some tiles to my level through jjTilesFromTileset to use in background layers. They generally look good with the native palette, but noticed there's 1 crucial color that looks ugly and corresponds to the darkest color used in the native ground tiles. So either the background will look partly ugly or the darkest color of the layer4 ground will. You know I suck at scripting so the answer may be obvious, but is there some way to recolor or swap palette entries to one or more specific tiles by their ID? None of my jjPal fiddling seemed to work. Any example or tip will be highly appreciated!
__________________
Add SlazRabbit on Xbox Live if you want to play some GoW1/2/3/J or Destiny1/2. Jazz Jackrabbit 2 Forever!! Civilian Defence Force - Jazz2 Visual Fantasers |
Dec 8, 2017, 02:30 AM | |
jjTilesFromTileset accepts an extra parameter for that very purpose, named paletteColorMapping . You want most colors to be mapped to their current color (paletteColorMapping[i] == i ), and those that look wrong to be mapped to something else.If you find that it's more complicated than that, and some colors should be replaced with one color in one context and another in another context, jjPIXELMAP is there to give you a helping hand. The documentation offers an example that already does something quite similar.
__________________
I am an official JJ2+ programmer and this has been an official JJ2+ statement. |
Dec 10, 2017, 04:39 PM | |
I somehow overlooked that parameter and had it set to null without questioning myself.. Thanks!
__________________
Add SlazRabbit on Xbox Live if you want to play some GoW1/2/3/J or Destiny1/2. Jazz Jackrabbit 2 Forever!! Civilian Defence Force - Jazz2 Visual Fantasers |
Jan 6, 2018, 08:13 AM | |
Question time!
I want to combine the Slide event in my level with Steady Light. I'm using Mez03, and I want the neon-tube-like animated platforms to light up in the dark. So far I have no idea how to accomplish that. Also, while on the same topic, is there a way to change the "Illuminate Surroundings" parameter to act as a steady light, rather than Flickering? |
Tags |
angelscript, code, jcs, request |
«
Previous Thread
|
Next Thread
»
Thread Tools | |
|
|
All times are GMT -8. The time now is 03:26 PM.
Jazz2Online © 1999-INFINITY (Site Credits). Jazz Jackrabbit, Jazz Jackrabbit 2, Jazz Jackrabbit Advance and all related trademarks and media are ™ and © Epic Games. Lori Jackrabbit is © Dean Dodrill. J2O development powered by Loops of Fury and Chemical Beats. Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Original site design by Ovi Demetrian. DrJones is the puppet master. Eat your lima beans, Johnny.