Apr 28, 2015, 12:28 PM | |
Not built-in. You'll have to do the math yourself.
|
May 7, 2015, 08:58 AM | |
Greetings.
I've come up with idea to make a custom gamemode - Prop'n Hunt. The rules are simple: there's two teams in this game; red team for hunters, those who will hunt down blue and the blue team - props (morphed into pickups or level's furniture players). Red team starts with black screen, that lasts for 15 (or more) seconds, then they get warped into the level. For that time the blue team must morph into something, that might be well disguised, then hide (the level is planned to be very big). Blue team can't shot or hurt anyhow, but a red team member also can't shot a fake furniture/pickup, because he'll get hurt then. Each player has one live per round... Okay, now to the business - the problem is that I'm not well acknowledged with AngelScript, so I won't be able to make it alone. I also didn't come up with HOW a blue team member is going to choose his disguise (maybe there's chat command, or a keybutton click on nearby pickup, or something?), so I'm asking you for help, if you're interested in that...
__________________
ELC leveldesigner, [CDFLogistics] leader, [CDF] consult member, a music composer. Unite people under one idea. |
May 7, 2015, 09:49 AM | |
So basically...a glorified hide and seek.
People who know the level well won't be fooled, unless the real pickups/furniture locations are randomized each round/cycle. Okay I'm not really helping technical wise, though that's my two cents on the concept. EDIT: Oh, so it's based off something else.
__________________
Last edited by Treylina; May 7, 2015 at 10:28 AM. |
May 7, 2015, 12:19 PM | ||
Quote:
__________________
~XxMoNsTeR |
May 23, 2015, 01:06 AM | |
Okay, I'm looking for a way to create an eyecandy effect for my level. I'd like tiny particles to fall gently from the top of the players screen. Imagine little stars falling down, or diamond dust falling while being illuminated by moonlight.
I still know little about AS, so I started experimenting. I've looked at jjParticle's ICETRAIL since those particles felt like they could do the trick. However, how do I make a few of them fall from the top of the screen? Do I need to make a jjCanvas relative to the players position and attach the jjParticle(s) to that? If the jjParticle idea is all wrong for some reason, could a custom object using the icetrail anim work? Either way, I'd like some help! Thanks in advance!
__________________
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 |
May 23, 2015, 04:06 PM | |
Code:
void onPlayer(jjPLAYER@ play) { jjPARTICLE@ part = jjAddParticle(PARTICLE::ICETRAIL); if (part !is null) { part.xPos = play.cameraX + (jjRandom() % jjSubscreenWidth); part.yPos = play.cameraY; } } jjRandom , or a frequency different than one particle per tick (regardless of screen width), but the important thing is that jjPLAYER::cameraX and jjPLAYER::cameraY are used for translating between level coordinates and screen coordinates.If you end up deciding against PARTICLE::ICETRAIL, though, you could also create your own tiny particle class containing position, (maybe) color and (maybe) lifetime values, make an array of that class, and draw blue pixels (or small rectangles or something) directly to a non-layer jjCANVAS based on the array's contents' positions. But ICETRAIL is simpler if you don't want to figure out classes. |
May 24, 2015, 05:13 AM | ||
Quote:
jjRandom makes it look fine, naturally there are more particles on the screen while standing still and less while the screen is scrolling. There's no need looking into classes or changing the frequency at all.I will comment your name atop the script file.
__________________
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 |
May 24, 2015, 04:07 PM | |
I don't have the will to. The solution for tiles would involve hiding all layers and using the jjPIXELMAP constructor from tile ID to create sprites to be drawn with jjCANVAS::drawResizedSprite in onDrawLayer# hooks. It wouldn't work correctly for animated tiles so you'd have to handle those separately. Objects would preferably be modified within behavior functions to use jjDrawResizedSpriteFromCurFrame instead of jjDrawSpriteFromCurFrame. It wouldn't work for rotated sprites though - in fact, no as simple solutions would, so hopefully you don't need those. Players should have their jjPLAYER::invisibility property set to true and their sprites, and optionally names and other things, such as Spaz's bird, drawn manually with jjDrawResizedSpriteFromCurFrame. There's not much that can be done about particles either but luckily they're small so it's possible to get away with it. It also wouldn't have effect on textured backgrounds, water, etc. I wouldn't bet my money on stable fps after all of that is done.
__________________
I am an official JJ2+ programmer and this has been an official JJ2+ statement. |
Jun 30, 2015, 05:57 AM | |
Ok, so it seems like commands on "onChat & onLocalChat()" with Server don't work for me, what I mean is I put a if (stringReceived == "/test") and jjAlert("s") when I do that. And when I do it as a server it doesn't work, when I do it as a client it works! Did I do something wrong, or it just doesn't work with the Server?
__________________
~XxMoNsTeR |
Jun 30, 2015, 10:19 PM | |
Commands (even invalid ones) are not supposed to be intercepted by the chat hooks at all. Any time they are is an error.
|
Jul 1, 2015, 02:25 PM | |
So, can you not make custom server commands in AS?
|
Jul 1, 2015, 02:45 PM | |
All messages starting in '/' are reserved by JJ2+ for clarity and forward compatibility. Similarly, due to collisions with whispering and admin chat I cannot recommend the use of '@' or '>' to signify custom commands. Nothing prevents script writers from using one of the other 23 non-alphanumeric ASCII characters present on every keyboard, however. Or, using my by far favorite solution, words.
__________________
I am an official JJ2+ programmer and this has been an official JJ2+ statement. |
Jul 31, 2015, 01:40 PM | |
Ok, jjMaxLives doesn't work. Why, doesn't it? I just used it and it says it isn't declared, when I declare it and set a value to it, it's fine. I typed it correctly, and also tested it with a simple thing on my tests.mut, with jjAlert(jjMaxLives + ""). I also have the latest plus version. :?
__________________
~XxMoNsTeR |
Jul 31, 2015, 01:55 PM | |
And why is it there in the angelscript readme? That confused me. I thought nobody noticed that.
__________________
~XxMoNsTeR |
Jul 31, 2015, 05:06 PM | |
As SE said, it's an error. IIRC it had a temporary implementation, but that didn't end up working for clients, and it was a minor enough property that we opted for taking it out rather than fixing it. But then that particular change got missed while updating the documentation later.
|
Aug 18, 2015, 11:59 AM | |
re: the Angelscript Requests part of this topic:
I'd like to see a mutator that automated some of the CTF codes, but I'm not enough of an expert on them to want to do it myself. At the very least, it would be nice if flag carriers could just announce their health (via teamchat) automatically--when picking up a flag, when their health changes, or when anyone asks "h" or "h?" via teamchat. Trying to type and send a number while running for my life tends not to be very pleasant. |
Aug 19, 2015, 12:59 AM | ||
Quote:
__________________
~XxMoNsTeR |
Aug 29, 2015, 02:04 PM | |
By setting the global property
jjWarpsTransmuteCoins to false on level load.
__________________
Mystic Legends http://www.mysticlegends.org/ The Price of Admission - Hoarfrost Hollow - Sacrosanct - other - stuff |
Aug 29, 2015, 09:26 PM | |
This is the code i've put:
void onLevelLoad() { jjWarpsTransmuteCoins = false; } Did I do something wrong? Cuz it's not working. EDIT: NEVERMIND it does. I was a stupe and ran it through JCS lol. Thank you cooba this helped a lot
__________________
JJ2 nickname: AlexM Last edited by ScarXL; Aug 29, 2015 at 09:49 PM. |
Sep 3, 2015, 05:04 PM | |
Read the AngelScript manual. If you still have problems, come back.
Also, that's a pretty vague problem. |
Sep 4, 2015, 04:35 AM | |
Read the code in question for Ozymandius, look up stuff you don't understand in the AS readme, and when in doubt, screw around with how a piece of code works until you understand it.
One thing to avoid doing in this case is copypasting code you don't understand. It will technically work most of the time, but you won't learn from it. |
Sep 4, 2015, 09:02 AM | |
Preferably start by reading a good C/C++/C#/Java tutorial. Then read all of the following pages in full:
__________________
I am an official JJ2+ programmer and this has been an official JJ2+ statement. |
Dec 8, 2015, 01:19 AM | |
I have tried literally everything to align my texts to the center, but nothing worked.
It's hard without examples. Can I please have an example of ANY possible way to create ANY kind of centered text? Last edited by DennisKainz; Dec 8, 2015 at 01:26 AM. Reason: I wrote "mode" instead of "way" |
Dec 8, 2015, 03:45 AM | |
Thanks for the help, and sorry for the disturb.
I now can make my custom text! Last edited by DennisKainz; Dec 11, 2015 at 09:22 AM. |
Dec 11, 2015, 09:24 AM | |
One more thing ... How do I get an object to activate even if Jazz has never been close enough to it? Example: Jazz never walked further to the left than X tile 32, but the enemy is at X tile 224. How do I get the enemy to activate already, without Jazz actually being any nearby?
|
Dec 11, 2015, 10:19 AM | |
Seems to me the simplest way would be to place the object somewhere around X tile 32, but have it reposition itself immediately upon creation. Alternatively, I haven't tested this but it looks plausible:
Code:
jjOBJ@ ActivateEventAt(int xTile, int yTile) { if (jjParameterGet(xTile, yTile, -1, 1) == 1) //event already activated return null; jjParameterSet(xTile, yTile, -1, 1, 1); //bit meaning that this event is active return jjObjects[jjAddObject(jjEventGet(xTile, yTile), xTile * 32 + 15, yTile * 32 + 15, 0, CREATOR::LEVEL)]; //or it might be + 16 for the position offsets if you want to get it exactly right... I don't remember offhand } jjOBJ::deactivates is false .
|
Dec 11, 2015, 12:14 PM | |
There's a tinyish problem ...
The expression does nothing. AngelScript recognizes it as valid and all, but the inactive stays inactive. I even made sure a specific item first and then all items do not deactivate, but nothing. It doesn't affect anything. Then I tried to replace xTile and yTile with their actual values. Still nothing. It didn't work as a stand alone, so I tried to inject it in onMain(), but it said "Expected ; Instead found @" Then I tried to remove the upper path, the one who returns null, and only kept the other. Guess what? Nothing! In the end, I tried to add the "else" line between the two paths. And still nothing! Maybe I should get back to tileset making ... I said MAYBE |
Dec 11, 2015, 04:33 PM | |
What numbers are you passing as arguments and what event is at that location?
|
Dec 12, 2015, 01:15 AM | |
At first, I tried keeping "xTile" and "yTile", supposing they'd scan the whole level.
Then, I used the event location: 28, 7 (JCS). I tried to use as arguments both 28, 7 and 27, 6 (starting from 0). And the event is a boll platform with a custom behavior used for moving it left and right, changing direction when it collides with a slide event, that I use as a sort of "Stop Platform" Last edited by DennisKainz; Dec 12, 2015 at 01:16 AM. Reason: I said "Object" instead of "Event" |
Dec 12, 2015, 11:32 AM | |
Okay I created a 256-by-64 level with a start position in the top left corner and a piece of seeker ammo in the bottom right area, at position 252,60. Then I gave it this complete script:
Code:
void onLevelLoad() { jjObjectPresets[OBJECT::SEEKERAMMO3].behavior = MyObject; jjObjectPresets[OBJECT::SEEKERAMMO3].deactivates = false; } void onLevelBegin() { ActivateEventAt(252, 60); } void MyObject(jjOBJ@ obj) { jjAlert("I am active!"); } jjOBJ@ ActivateEventAt(int xTile, int yTile) { if (jjParameterGet(xTile, yTile, -1, 1) == 1) return null; jjParameterSet(xTile, yTile, -1, 1, 1); return jjObjects[jjAddObject(jjEventGet(xTile, yTile), xTile * 32 + 15, yTile * 32 + 15, 0, CREATOR::LEVEL)]; } Are you hosting the level in MP? (Though if you were, I'm not sure why you'd be bothering with this, since the object would be activated anyway.) Boll platforms don't appear in MP servers unless they're set to MP-only.... |
Dec 12, 2015, 01:04 PM | |
My bad. I did use deactivates = false, but not with jjObjectPresets. Now it works flawlessly!
|
Tags |
angelscript, code, jcs, request |
«
Previous Thread
|
Next Thread
»
Thread Tools | |
|
|
All times are GMT -8. The time now is 03:12 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.