Oct 30, 2013, 06:28 PM | |
I want to make a TNT-like explosion with a custom radius. So basically I want to recreate what appears to be a part of BEHAVIOR::TNT, but I have no way to see inside that behavior, and mine needs to as close as possible. Any help? I have no idea what the shape should be, how the force parameter passed to onObjectHit should be calculated, etc.
EDIT: Aaand another question so soon. Anyone have the code (or just a mathematical description) for pickups bobbing up and down? Seems that calling behave() with draw = false gets rid of it, which makes sense. But I want a pickup with its own sprite, and without the bobbing it looks jarringly out of place among the original pickups. I'm having trouble replicating it from observation, e.g. it isn't in sync with other pickups and stops when shot by bullets but not when moved by belts... Last edited by minmay; Oct 30, 2013 at 10:38 PM. |
Oct 31, 2013, 01:53 AM | ||
Quote:
Code:
int frame = obj.objectID * 8 + jjGameTicks; if (obj.yPos > jjWaterLevel) frame = frame*2 + (int(obj.xPos) + int(obj.yPos) * 256)*16; else frame = (frame + int(obj.xPos) + int(obj.yPos) * 256)*16; if (obj.ySpeed == 0) jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos + jjSin(frame)*4, obj.curFrame, obj.direction); else jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction);
__________________
Mystic Legends http://www.mysticlegends.org/ The Price of Admission - Hoarfrost Hollow - Sacrosanct - other - stuff |
Oct 31, 2013, 05:11 AM | |
I modeled this little script idea after the Adventure Island game for NES, where you need to eat food to stay alive, but eggplants are not edible and instead hover over you with creepy music playing and make you starve faster. In reality I'm trying this out for something completely different, but making an Adventure Island-esque level by the way isn't a bad idea. :P
__________________
"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) |
Oct 31, 2013, 09:55 AM | ||||
Quote:
onObjectHit is okay, but without more direct access to the underlying collision code, I'd honestly be tempted to spawn a bunch of invisible PLAYERBULLET objects in a circle around the explosion and give them .animSpeed values based on their distance from the center. For extra credit, you could also search through the object list, decide which ones are near enough, and if they have .isBlastable set to true, change their .xSpeed and .ySpeed values.Quote:
determineCurAnim should be fine?Quote:
Code:
if (obj.ySpeed == 0) { int frame = obj.objectID * 8 + jjGameTicks; if (obj.yPos > jjWaterLevel) frame = frame*2 + (int(obj.xPos) + int(obj.yPos) * 256)*16; else frame = (frame + int(obj.xPos) + int(obj.yPos) * 256)*16; jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos + jjSin(frame)*4, obj.curFrame, obj.direction); } else obj.draw(); |
Oct 31, 2013, 11:54 AM | |||
Quote:
Quote:
Bah, you didn't even convert those integer multiplications to bitshifts! Last edited by minmay; Oct 31, 2013 at 11:58 AM. Reason: yes i know the compiler does it |
Oct 31, 2013, 04:45 PM | |||
Quote:
Quote:
EDIT: After some testing it looks like spectating players hold onto their blink value and it gets sent to other players, but doesn't decrement. I can set it to -210 (any lower, or above 0, and it gets reset before it can get sent to other players). Currently I'm using that to test for spectating; if it's possible for it to get sent to other players while lower than -209, then I don't seem to be catching it in onPlayer, and even if it is I can just make sure the value stays at -210 for two consecutive frames. Last edited by minmay; Oct 31, 2013 at 05:31 PM. |
Nov 1, 2013, 04:23 AM | |
Okay, more trouble.
I now have spawning objects in relevance to player position covered, but now I'm having trouble with object behavior. Specifically, I'm trying to spawn falling bricks that would behave exactly as if spawned by the Queen boss, minus the damage effect. Spawning works like it should, but the behavior is a problem. I looked through the documentation and I understand that enemy projectiles are unaccessible as objects as of now, so I had to experiment. Closest I got so far is modifying RF projectiles, which leave a rockety trail and explode on contact. It looks kind of cool, but because of the object type I don't know how to make them ignore walls they would fall from and I'd rather have them bump on a surface and then fall a little ways down like they originally do instead of exploding with a recoil effect (I'm doing this thing for a dramatic effect, not as harmful obstacles). Any suggestions?
__________________
"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) |
Nov 1, 2013, 05:02 AM | |
You're looking for OBJECT::BOUNCEONCE.
__________________
Mystic Legends http://www.mysticlegends.org/ The Price of Admission - Hoarfrost Hollow - Sacrosanct - other - stuff |
Nov 1, 2013, 08:49 AM | |||
Quote:
Quote:
|
Nov 1, 2013, 09:51 AM | |
Wow, I didn't expect it to be that simple. Then again, BOUNCEONCE seems extremely logical, but because of how it's named I never noticed it on my own. My suggestion would be to put this right under QUEEN in the documentation... Unless nobody else finds this unobvious?
At any rate, I got my desired script scene. I even finally figured out the distinction between objects and behaviors... I guess. It's almost perfect. The only thing I could use is the screen shaking exactly like when falling rocks are triggered, except continuously. To make things harder, this has to work in tandem with a limit x scroll moving a good ways through the level. I have absolutely no idea how to even approach this problem. :B Expected them to be indented right under corresponding enemies, then looked around and was too blind to find them, I suppose.
__________________
"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) |
Nov 1, 2013, 10:12 AM | |
It would make a lot of sense to have it be BEHAVIOR::QUEENBULLET along with so many other boss sub-behaviors, I agree, but it has the relatively unique status of being its very own
jjObjectPresets slot to contend with. I dunno. More extensive documentation of the various behaviors is a fine idea and also kind of a time-intensive one.There's no AngelScript access to the camera-shaking code yet, basically because blur seemed to indicate in a comment somewhere that it was more complicated than he'd expected, so I've never taken the time to try it out. You could try shimming something together using jjPLAYER::cameraFreeze , but I don't know offhand how that would interact with the limit x scroll stuff.
|
Nov 3, 2013, 02:49 AM | |
In the weeks before joining the Plus team I actually annotated part of the camera control function for my Splitscreen Stereoscopy project. I've primarily focussed on the clearly controlled camera modes. Mostly the slides at the end of the level and during the Robot Boss cutscenes, and the code that keeps the camera pointed at one place. The part that I haven't fully annotated yet ('normal camera movement') almost certainly contains the nudging code (because 200 ops is somewhat more than I'd expect for just 'normal camera movement').
I figure we could hook the entire thing and expose several AngelScript functions to access its functionality.
__________________
|
Nov 11, 2013, 07:33 AM | |
Hi
Can you make Enter/Exit the door with AREA::PATH code? but i can't find "Doors" in angelscript code snippets. See picture s9.postimg.org/46baxl0vj/jc2.png Enter Door - Pos: 215, 85 Exit Door - Pos: 8, 8 Text Message "Press UP to enter through the door!" & "Press UP to exit through the door!" Thanks |
Nov 14, 2013, 04:18 AM | |
Soory double post!
angelscript doesn't work for me this entrance/exit door and more doors, can you help me? Code:
void onPlayer() { if (jjEventGet(p.xPos/32, p.yPos/32) == AREA::PATH) { canvas.drawString( (215*32) - 4, (85*32) - 4, "Press UP to entrance door!", STRING::SMALL, STRING::BOUNCE, 1 ); canvas.drawString( (8*32) - 4, (8*32) - 4, "Press UP to exit door!", STRING::SMALL, STRING::BOUNCE, 1 ); } switch () { case 10: x = 215; //Entrance door y = 85; break; case 11: x = 8; //exit door y = 8; break; } } } Last edited by P4rr0t; Nov 14, 2013 at 04:39 AM. |
Nov 14, 2013, 05:16 AM | |
Code:
void onMicky() { if (bird) { "why you no fly?", kick = bird; } }
__________________
Mystic Legends http://www.mysticlegends.org/ The Price of Admission - Hoarfrost Hollow - Sacrosanct - other - stuff |
Nov 14, 2013, 06:22 AM | ||
Cooba, it is micky doesn't exist (already banned from jj.net)
Ask Violet CLM or Foly, read my code, pls Quote:
|
Nov 14, 2013, 07:05 AM | |
I did use "EragonParrot" as a name when testing Hereafter for about a week straight
__________________
Mystic Legends http://www.mysticlegends.org/ The Price of Admission - Hoarfrost Hollow - Sacrosanct - other - stuff |
Nov 14, 2013, 11:27 AM | |
Some things that come to mind...
|
Nov 15, 2013, 04:53 AM | |
@Violet CLM
Okay, it's not working my code... can you fix my code? Thanks And No triggers See picture: s11.postimg.org/akpdji9lf/image.png Code:
void onPlayer() { if (jjEventGet(p.xPos/32, p.yPos/32) == AREA::PATH && jj[UP]) { jjCANVAS@ jjDrawString( (215*32) - 4, (85*32) - 4, "Press UP to entrance door!", STRING::SMALL, STRING::BOUNCE, 1 ); jjCANVAS@ jjDrawString( (8*32) - 4, (8*32) - 4, "Press UP to exit door!", STRING::SMALL, STRING::BOUNCE, 1 ); } if switch () { case 10: x = 7; //Entrance door y = 7; break; case 11: x = 214; //exit door y = 84; break; } } } |
Nov 15, 2013, 09:47 AM | |
That's all but unchanged from the last time you posted your code, and I already listed several improvements you could make in it. If you're coming at this with no familiarity with coding, I'd suggest you start with something simpler. See if you can make a 'trigger zone' that turns on two different triggers at once, for example.
Last edited by Violet CLM; Nov 15, 2013 at 10:11 AM. |
Nov 16, 2013, 03:11 AM | ||
Quote:
Sorry, the code is hard for me. What about Warp with press UP key to entrance/exit door witout PATH/Trigger? can you create code "Doors" in Angelscript code snippets. I'm waiting for you http://www.jazz2online.com/snippets/ |
Nov 17, 2013, 04:36 AM | ||
Quote:
Sorry, the code is hard for me. Can you create code "doors" in Angelscript code snippet database. What about TEXT/WARP with message "Press UP to entrance/exit door" (p.KeyUp) and no triggers. Pos: 8,8 = Entrance door Pos: 215,85 = Exit door Thanks |
Nov 17, 2013, 12:29 PM | |
If you don't understand the most fundamental basics of how coding works, giving you something like that as a single unit really will not help you at all. Please do some research, read some manuals, try stuff out on your own.
Last edited by Violet CLM; Nov 17, 2013 at 12:41 PM. |
Nov 19, 2013, 02:56 AM | ||
Quote:
Code:
void onFunction4(jjPLAYER@ p, jjCANVAS@ canvas) { if (p.KeyUp) { p.DrawString(212*32, 84*32-16, "|Press UP to entrance door!",STRING::SMALL,STRING::BOUNCE); p.WarpToTile(8,8 true); //Entrance door } } |
Nov 20, 2013, 02:00 AM | ||
Quote:
Code:
void onFunction4(jjPLAYER@ p) { if (p.KeyUp); p.warpToTile(7,7, true); //Entrance door } jjAlert("&"); jjAlert("&"); jjAlert("&"); jjAlert("&"); jjAlert("&"); jjAlert("&"); jjAlert("|**Press UP to entrance door!**"); jjAlert("&"); } |
Nov 20, 2013, 02:48 AM | |
Yes, but what Violet is saying is that to get good at coding you have to start fairly small.
|
Nov 20, 2013, 07:01 AM | |
Nov 20, 2013, 07:20 AM | ||
True, but...
Quote:
|
Nov 20, 2013, 07:26 AM | |
His immediate problem lies much deeper than not understanding AngelScript.
__________________
Mystic Legends http://www.mysticlegends.org/ The Price of Admission - Hoarfrost Hollow - Sacrosanct - other - stuff |
Nov 26, 2013, 05:30 PM | |
Not currently.
|
Dec 22, 2013, 02:38 AM | |
Talking about being bad at coding, could someone point me in the right direction to create a very simple script that changes some palette colors?
I'd like to get a fixed number of jjPalette entries for a level's tileset changed at onLevelLoad during the entirety of the game. I could probably look this up on the PlusPalette example, but I'm too lazy to dig into it.
__________________
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 22, 2013, 06:56 AM | |
Readme section completely dedicated to operations on palettes
Example of a script that changes the palette onLevelLoad
__________________
I am an official JJ2+ programmer and this has been an official JJ2+ statement. |
Dec 23, 2013, 12:35 PM | ||
Quote:
__________________
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, 2014, 03:01 PM | |
There's a problem.
AngelScript usually allows me to make Jazz run at higher speeds than 4 or 8, but in some levels, or maybe when I'm standing on the ground, the x speed is limited to 4 on walk and 8 on run. I also can't find the variables corresponding to the spike boll's Sync, Speed etcetera, assuming they are part of var[11]. And I can't change any object's animation speed. The animSpeed command seems to do nothing with eg. the Labrat. And this: canvas.drawSprite([xPos], [yPos], [ANIM::set], [sub-anim], [frame], SPRITE::PALSHIFT, [param]); Doesn't work. The param part isn't considered a valid part of the expression, as I keep on getting "No matching signatures for [expression]". So I can't change the deco's color. And ... is there a way to check whether Jazz is standing on the ground? (like "platform", but checking for masked tiles instead) And the virtual keycodes wiki doesn't tell me which are the virtual keycodes for each letter. And I can't use the texture tools. It ALWAYS gives me "Identifier [style || texture] is not a data type". Last edited by DennisKainz; Jan 8, 2014 at 06:27 AM. |
Jan 8, 2014, 09:18 AM | |||||||||
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
jjMaskedHLine(player.xPos-12,24,player.yPos+20) should work. You can also perform a check for ySpeed==0 just to be sure.Quote:
Quote:
__________________
I am an official JJ2+ programmer and this has been an official JJ2+ statement. |
Jan 8, 2014, 10:31 AM |
DennisKainz |
This message has been deleted by DennisKainz.
|
Jan 10, 2014, 08:46 AM |
DennisKainz |
This message has been deleted by DennisKainz.
Reason: Nevermind! Mistake of mine!
|
Jan 10, 2014, 10:22 AM | |
Thank you for the advices, Sir Ementaler. You are REALLY too good to be real.
I have a new problem: I try to draw ANIM:EVILDEVAN with jjDrawSprite, but JJ2 implicitly changes it into ANIM::JAZZ. Same with a few other animation sets, like ANIM::MENU and ANIM::BILSBOSS. If you can help me out, I will CERTAINLY mention you in my episode's credits. |
Tags |
angelscript, code, jcs, request |
«
Previous Thread
|
Next Thread
»
Thread Tools | |
|
|
All times are GMT -8. The time now is 02:49 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.