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

Idea: A program that variates tiles in a level

DennisKainz DennisKainz's Avatar

JCF Member

Joined: Dec 2005

Posts: 416

DennisKainz is notorious for his worthless posts

Dec 9, 2015, 10:55 AM
DennisKainz is offline
Reply With Quote
Lightbulb Idea: A program that variates tiles in a level

Basically, this is how it should work:
You tell the program to find one or more specific tiles.
Then you tell it to replace the previous tile(s) with one or more different tiles.
The tiles found will be randomly replaced around the level.

Example:

This is what you got in the level:


You tell the program to find this:

And replace it with these:


Then you do the same with this:

And you replace it with these:


The program will give you something like this:
Primpy Primpy's Avatar

JCF Member

Joined: Nov 2014

Posts: 843

Primpy is an asset to this forumPrimpy is an asset to this forum

Dec 9, 2015, 11:33 AM
Primpy is offline
Reply With Quote
Well, that would be something, but...

1. It's pretty much useless. How much of a lazybones can you be to use a program instead of placing some random tiles by yourself? Just spend a few more seconds placing random tiles, your hand won't hurt, trust me.

2. I highly doubt that someone is going to do this. It's most likely insanely hard to do such a thing or maybe even impossible because different tilesets have different tile placement.
__________________

"Floppy ears and a big butt?" - Slaz
Seren Seren's Avatar

JCF Member

Joined: Feb 2010

Posts: 866

Seren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to all

Dec 9, 2015, 02:07 PM
Seren is offline
Reply With Quote
I recall Violet had shown screenshots of MLLE doing this. I don't think the current build is capable of it but it's open source, feel free to fork it, as did I when I wanted to fix the flood fill tool (Violet if you're reading this go accept or reject my pull request from 8 months ago).
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,993

Violet CLM has disabled reputation

Dec 9, 2015, 07:18 PM
Violet CLM is offline
Reply With Quote
This is precisely what MLLE's ctrl key is for, particularly in combination with flood fill, yes. Though that won't be able to detect separated wall areas, so you have to hunt them down individually, but a whole lot of manual randomization time still gets saved for you.

That said, there's also some appeal to making AngelScript do it for you instead, since that way you don't need to worry about remembering to do randomization every time you add a new wall or whatever to the level. Just fill in all the walls with your standard tile and let them be randomized at runtime.

In any case, you're still doing a lot more work in that example picture than you need to. What I do (among other things) in violetmaze5.j2as is construct walls entirely out of single tiles, and then the script not only randomizes the individual wall tiles, but also figures out whether they're floors, ceilings, etc. That's really all you need in simple tilesets like Diamondus, Carrotus, or Castle. So instead of

, I prefer
__________________

Last edited by Violet CLM; Dec 9, 2015 at 07:29 PM.
DennisKainz DennisKainz's Avatar

JCF Member

Joined: Dec 2005

Posts: 416

DennisKainz is notorious for his worthless posts

Dec 9, 2015, 11:06 PM
DennisKainz is offline
Reply With Quote
Thanks a lot for your example! It didn't only turn useful for tiles, but for a lot of other things!
I now can select more values at once for a purpose.

There's one only problem: Whatever I try to use multiple values for, it says "No conversion from "uint[]" to "uint" available"

How do I check or change multiple expressions at once for weapons, enemies, coins and all?

Last edited by DennisKainz; Dec 9, 2015 at 11:26 PM.
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,993

Violet CLM has disabled reputation

Dec 9, 2015, 11:34 PM
Violet CLM is offline
Reply With Quote
I'm not sure exactly what you're asking, but I have two guesses, and hopefully one of them is correct:
If you want to know how to get a random value from an array: ArrayName[jjRandom() % ArrayName.length()]
If you want to know how to tell whether a specific value is in an array: ArrayName.find(SpecificValue) >= 0
Otherwise, please give a little more context.
__________________
DennisKainz DennisKainz's Avatar

JCF Member

Joined: Dec 2005

Posts: 416

DennisKainz is notorious for his worthless posts

Dec 9, 2015, 11:45 PM
DennisKainz is offline
Reply With Quote
This was exactly what I wanted to know! Thank you again!
zapS zapS's Avatar

JCF Member

Joined: Jan 2005

Posts: 84

zapS is doing well so far

Jan 1, 2016, 04:57 PM
zapS is offline
Reply With Quote
the program you describe in the first post sounds really simple to do. if you still need something like that i might do it if i get the time.
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 09:37 PM.