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

MCE rain?

lorenaustin

JCF Member

Joined: Jan 1970

Posts: 1

lorenaustin has disabled reputation

May 9, 2020, 02:27 AM
lorenaustin is offline
Reply With Quote
MCE rain?

I saw in a level, a medivo level if it helps someone, i played, and when i got onto a point, it suddenly started to rain; i was running in there, got onto another point and it stopped raining. How is that possible? I want to make that in the level i'm preparing and i don't remember how, or where did i get the 3 levels. Can someone help?
PurpleJazz

JCF Member

Joined: Aug 2006

Posts: 853

PurpleJazz is OFF DA CHARTPurpleJazz is OFF DA CHARTPurpleJazz is OFF DA CHART

May 9, 2020, 04:18 AM
PurpleJazz is offline
Reply With Quote
I assume you're probably referring to the level Sommerdamm by Loon (ab22ctf08.j2l).

If this is the case, then the rain effect is actually achieved by using AngelScript as opposed to MCEs.

Code:
void onFunction0(jjPLAYER@ play) {
     jjIsSnowing = true;
}
void onFunction1(jjPLAYER@ play) {
    jjIsSnowing = false;
}
This level uses Text events with the JJ2+ parameter "AngelScript" set 1 so that different TextIDs can correspond with functions in the level script file. In this instance, the level places AS-enabled Text events with ID 0 and 1 in the appropriate locations to enable and disable the rain respectively when the player touches them. jjIsSnowing is the name given to the global property determining if the level should currently have a weather effect or not.

Additionally worth noting that the level uses a custom rain effect as opposed to the default "bubble" rain that comes built into JJ2+. The script snippet for the more realistic-looking rain can be found here.
Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

May 9, 2020, 10:51 AM
Violet CLM is offline
Reply With Quote
It's also possible to achieve this without the use of angelscript, provided you're making a linear level and don't want the rain to turn on and off again freely as you go back and forth between the two spots.

The "JCS Events" section of the JJ2+ documentation describes (under "Feb 14 2015 Additions") some parameters you can add to the Snow event, which lets you cause rain instead of snow using the "Type" parameter, and which lets you use the Snow event to turn rain off using the "Off" parameter. (Or if you're using MLLE, those parameters are already available for you.) The snow event activates when you get near it, not when you cross over the exact tile it's on.
__________________
Reply

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 03:05 PM.