Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Mystery Dungeon Script ;p [help wanted]

32 replies · 8,197 views · Started 07 September 2007

Wouldn't it be neat to have randomly generated dungeons, enemies, and screen layouts? Heck yeah! Well i'm currently trying my hand at the second one any ways...who knows, the rest may not be far off. Then youd have a ZC quest that's different every time through! Sweet.

...Anyways on to my script idea;


import "std.zh"

//============================================================================
// Creates 8 random enemies in ADDITION to current screen enemies. ;p hehe..
// D0-D7 Enemies to be spawned
// D0 being the weakest and
// D7 the strongest
//============================================================================
ffc script random_enemy_generator{

void run (int enemy1, int enemy2, int enemy3, int enemy4,
int enemy5, int enemy6, int enemy7, int enemy8){
int x;
int y;
int enemy_ticker = 8;
int RandNum = Rand(8);
npc spawnee;

while(true){

for (int enemy_ticker = 8; enemy_ticker > 0; enemy_ticker -= 1) {

if (RandNum == 7){
npc spawnee = Screen->CreateNPC(enemy8);
spawnee->X = is_walkable(x);
spawnee->Y = is_walkable(y);
RandNum = Rand(7);
} if (RandNum == 6){
npc spawnee = Screen->CreateNPC(enemy7);
spawnee->X = is_walkable(x);
spawnee->Y = is_walkable(y);
RandNum = Rand(7);
} if (RandNum == 5){
npc spawnee = Screen->CreateNPC(enemy6);
spawnee->X = is_walkable(x);
spawnee->Y = is_walkable(y);
RandNum = Rand(7);
} if (RandNum == 4){
npc spawnee = Screen->CreateNPC(enemy5);
spawnee->X = is_walkable(x);
spawnee->Y = is_walkable(y);
RandNum = Rand(7);
} if (RandNum == 3){
npc spawnee = Screen->CreateNPC(enemy4);
spawnee->X = is_walkable(x);
spawnee->Y = is_walkable(y);
RandNum = Rand(7);
} if (RandNum == 2){
npc spawnee = Screen->CreateNPC(enemy3);
spawnee->X = is_walkable(x);
spawnee->Y = is_walkable(y);
RandNum = Rand(7);
} if (RandNum == 1){
npc spawnee = Screen->CreateNPC(enemy2);
spawnee->X = is_walkable(x);
spawnee->Y = is_walkable(y);
RandNum = Rand(7);
} if (RandNum == 0){
npc spawnee = Screen->CreateNPC(enemy1);
spawnee->X = is_walkable(x);
spawnee->Y = is_walkable(y);
RandNum = Rand(7);

} enemy_ticker = enemy_ticker - 1;

} if (enemy_ticker < 1){
Quit();
}
}
}
bool is_walkable (int x, int y){

if(x<0 || x>240 || y<0 || y>160){
return false;
}
return Screen->ComboS[y+(x>>4)]==0;
}
}

OK, here is the next revision. It still doesn't work though. 😞 Something about bool(float) 23 error can't compile...It's out of my hands now, I could use some help.

Comments, suggestions, help?

Gleeok wrote:Wouldn't it be neat to have randomly generated dungeons, enemies, and screen layouts? Heck yeah! Then youd have a ZC quest that's different every time through! Sweet.
It's funny that you mention that...

Randomly generated dungeons, huh? So you made a script for random enemies, and bigjoe made a script for random screens. Now all we need is multiplayer and we basiclly have Zelda Four Swords.😃 It's a good idea (then random enemy, not the multiplayer). The only thing is you should be able to say the enemies have to be within this catagory, so they are not completly random.

_L_ wrote:It's funny that you mention that...

You know, usually when you say "It's funny that you mention that", it's followed by a reference that would explain some connection to a related topic....

The only thing is you should be able to say the enemies have to be within this catagory, so they are not completly random.

Well, what I was trying to do is have the script choose random enemies from a pool of 8.(D0-D7)
Although note that it's currently not in working condition yet.

Need to be able to spawn randomly on walkable tiles.

This simple function will do the job (I dunno who wrote it but it works good)


bool is_walkable(int x, int y)
{
if(x<0 || x>240 || y<0 || y>160)
{
return false;
}
return Screen->ComboS[y+(x>>4)]==0;
}

Call the function like so:
if (is_walkable(ene->X,ene->Y)) {//its okay to spawn here;}

if (enemy_ticker >=1){

might I suggest
for (int enemy_ticker = 8; enemy_ticker > 0;enemy_ticker -= 1) {

They way you are doing it is not wrong, i just find it neater, and easier to keep track of a for loop.
enemy_ticker = enemy_ticker -= 1

You'll want to change to:
enemy_ticker -= 1

you can also do:
enemy_ticker = enemy_ticker -1
(not -=)
They both do the same thing.

Besides those minor things your script looks good to me

oh and btw, _L_ do you enjoy driveing ppl nutz with your cryptic remarks? 😛

Sweet, i'll use that and try to get a revision that works.
} else { 😡

I got another update to add also. 😃

import "std.zh"


//------------------------------------------------------
// Creates a closed shutter in a random direction as
// long as there is a wall.-
// Once the enemies have been killed the shutter will open.
// This will not overwrite essential doors added for specific
// dungeon map layouts 😊
// Not used yet/ -random locked doors, boss doors, open doors-
//------------------------------------------------------

ffc script random_door_generator{ //ver1.0

void run(){

int RandNum = Rand(4);

if (RandNum == 0 && Screen->Door[DIR_DOWN] == D_WALL){
Screen->Door[DIR_DOWN] = D_SHUTTER;
} if (RandNum == 1 && Screen->Door[DIR_UP] == D_WALL){
Screen->Door[DIR_UP] = D_SHUTTER;
} if (RandNum == 2 && Screen->Door[DIR_LEFT] == D_WALL){
Screen->Door[DIR_LEFT] = D_SHUTTER;
} if (RandNum == 3 && Screen->Door[DIR_RIGHT] == D_WALL){
Screen->Door[DIR_RIGHT] = D_SHUTTER;
}
}
}

One small problem though....IT WONT CARRY-OVER!! Aaargh...

I guess the reason it's not carrying over is because it runs once then stops, i'm not really sure how to stick in inside a loop that is always running without it messing up the original simple design. ..(Other than that, it works super good though 😊 )

Carryovers are glitchy, well mabye just touchy there are rules to how they work (I think C-Dawg is the 'daddy' of figureing those out) 😃
Stuff like your door script, are the kind of things that I personally would use a Global script for instead of an FFC script (but that is just me) You could also just put the FFC on every screen you want the script on (we have paste special-->FFC y'know) 😉
But if you are intent on the carryover thing look around the ZScript forum the laws of carryovers are in there somewhere

OK, i'm working now on various changes to those, but the ffc paste special isn't pasting the script along with everything else, very annoying. Is it supposed too? Is there a bug in 579? I also couldn't find anything on carryover....hmm.

Stuff like your door script, are the kind of things that I personally would use a Global script for instead of an FFC script

Yeah but I was only intending it to be used for bonus/mini dungeons. 😉 Not for the whole game....although after I finish this quest I do intend to make a completely (half anyway) random dungeon spanning at least 15 maps/Dmaps.
I've put my zc wizardry4 project on hold untill I can get all the item, and mystery dungeon scripts together.

EDIT: I updated and made some changes to the initial script in post 1 but it not yet in working order...if you see what's wrong with it don't be shy.

It's like C- said, "it's always easier to understand a script you wrote rather than a script someone else wrote."...

russadwan wrote: and bigjoe made a script for random screens. .

My script hardly deserves recognition, as it primitive and lacks certain functions I'd like it to have. This is primarily because I don't know how to do certain things, like read from the FFC arguments and whatnot. I'll post the latest version of it anyway though.

ffc script randwarp_level1
{
void run ()
{
if(Game->Counter[CR_SBOMBS] == 32){
Link->PitWarp(1,32);
}
else{
Game->Counter[CR_SBOMBS]++;
Link->PitWarp(1,Rand(31));
}
}
}

What this does is warps you to a random screen from 0 to 1E if you have less than 32 super bombs.(In the quest Im working on, I use the super bomb counter as a screen counter.)

It is very important to note that the PitWarp function ignores dmap parameters, so if you use this script how it is, you will have to draw OFF of the dmap.

If you have amassed 32 "screens", it warps you to the second boss room. From there, you are warped to the next "floor",using a screen that has a checker script:


ffc script check_level1
{
void run ()
{
if (Game->Counter[CR_SBOMBS] <= 15){
Link->PitWarp(1,0);
}
else{
Link->PitWarp(2,0);
}
}
}

IF anyone would like to improve upon these horrendously primitive scripts, then, by all means. 😃 By the way, Gleeok, I've already started on a random dungeon quest.

Here are some shots.

User posted image
User posted image
User posted image
User posted image
User posted image

This is also a plug for 4matsy(a.k.a. Hypercrash) Those are his tiles. 😉

This is primarily because I don't know how to do certain things, like read from the FFC arguments and whatnot

Useing the FFC args is simple, just define vars in run, like so:

void run (int arg1, int arg2, int arg3)

then you can use them in the FFC script just like any other var.

If you ever have any script questions please feel free to ask in this forum (I know I asked some really newbish questions when I was learning ZScript, but DD and C-Dawg were very helpful) 😊

There really does need to be more good tuts on ZScript

Oh, well in that case.

import "std.zh"


//============================================================================
// Screen Counting System
// D0 = Dmap
// D1 = Number of Screens You've Drawn (Hexadecimal)
// D2 = Number of Screens Before Manditory Boss Encounter.
// This script assumes you are using the S_Bomb counter to count screens. Currently, there is no other way to display a variable on the subscreen.
//============================================================================

ffc script random_warp
{
void run (int arg1,int arg2,int arg3)
{
if(Game->Counter[CR_SBOMBS] == arg3){
Game->Counter[CR_SBOMBS]++;
Link->PitWarp(arg1,arg2);
}
else{
Game->Counter[CR_SBOMBS]++;
Link->PitWarp(arg1,Rand(arg2-1));
}
}
}

Should work =)

EDIT: But it doesn't. Hmm, what could I be doing wrong? The regular form works, but uh... hmmm

EDIT2: Nevermind, does work. I just keep forgetting that in Hex you have to subtract one because Zero is included... or something


There really does need to be more good tuts on ZScript


The we should have sscripting classes! Get it? Scrpting? Classes. Ok, there goes another bad pun. But seriously, we should just have a thread were everyone just adds a little info at a time and soon we have a scripting tutorial. We could call it Zcripting for dummies. Anyone agree with the idea?

That's awesome bigjoe. I'm stil revising the random enemy script, may take some time but be sure to check it out when it's done.

Also just a thought about random_warp; you should be able to warp link within a 8x8 Dmap. Might take some more lines of code though. I'm not sure how many. I don't know...

The random_door script works good however, and i'm currently designing a level based on that. Check that out. Also working more on that, but first I need to know the following.

How to use these:

! //!explain
l l // L's right....explain also
bool(poop) //haha...seriously though
++ //that's add 1 right. what about -1... // +-??
true; //is this like.... if (Link->Gay = true){
npc Zelda->realboobies = false 😛 }
} else { Link->O_Ozelda = ++; hahhahha, scripting boner jokes!!!!!

Seriously though, I really need help with some of these to make any progress with my scripts.

And Russdawn, I do agree. As soon as I get some fairly decent scripts together that's exactally what I plan on doing when I put a thread in showcase. Explain every single line of every script, 😉

The we should have sscripting classes! Get it? Scrpting? Classes

I don't get it......

Oh, one more; ShodowMancer, how's that weapon thingy coming along? I started messing with Link->Dir, Input, but how do you make charge weapons?..sorry, that's alot of stuff.

Quote:
[QUOTE]Then we should have scripting classes! Get it? Scripting? Classes

I don't get it......
[/QUOTE]

In C and C++, which Zscript was derived from, you had classes with a bunch of items in them. And credits for that pun go to Shadow Tiger, who made the pun without even realizing it at first.

But we should make a thread in Zscript help forum, and just post some simple scripts and break them down line by line. That's how I learned how to script, well, if you can call knowing how to write really simple scipts scripting.

But we should make a thread in Zscript help forum, and just post some simple scripts and break them down line by line. That's how I learned how to script, well, if you can call knowing how to write really simple scipts scripting.

I highly agree, I think Pure tried to do something like that, got it stickied in the scripting forum. There are a few basic tuts there.

class Scripting
{
public:
void writetut (string tutorial)
}

now there is a scripting class 😛 (btw I think classes are only in C++ not C its an OOP thing) [you down with OOP? yeah you know me] okay now I'm just getting silly

But seiously, I would like to see a stickied tutorial thread I would contribute when ever I can.

UPDATE: (darn I got so silly I missed a real question 😃 )


! //!explain
l l // L's right....explain also
bool(poop) //haha...seriously though
++ //that's add 1 right. what about -1... // +-??
true; //is this like.... if (Link->Gay = true){
npc Zelda->realboobies = false }
} else { Link->O_Ozelda = ++; hahhahha, scripting boner jokes!!!!!

! - this means NOT, as in
if (!Link->Gay) { Zelda = Happy; }
it reverses the meaning of any statement/eqasion
!= (Not equal)
|| means OR, example
if (Gleeok->State == Crazy || Gleeok->State == Confused) {ShadowMancer->WillHelp = true;}
bool, a varible type, only 2 possible values (true || false)
bool meSoCrazy = true;
++ adds one yes, you can also use +=1 and -=1 to add or subtract one, heck use any number you want
ShadowMancer->Coolness += 5; 😎
yes you are useing true and false correctly.
side note on bool, you can pass an integer to bool, 0 will = false any other number will be true. (I think ZScript still allows this)

Hope that helps

Oh, one more; ShodowMancer, how's that weapon thingy coming along? I started messing with Link->Dir, Input, but how do you make charge weapons?..sorry, that's alot of stuff.

Ah, well just got home from work got the next 2 days off, going to be scripting like a fiend. As of right now I got *Zilch* written at least not physically written, but its all here in my head just waiting to get out

well the simple secret of charge type weapons is to check if the player is holding the button and increment a varible, once the player releases the button the power of the weapon will be determined by the varible. here is a quick exampl of a '3 stage' charge weapon


int powLev = 0
while(Link->InputB)
{
powLev += 1
Waitframe();
}
if (!Link->InputB && powLev > 0)
{
//script to fire weapon
if (powLev < 10)
{
//do level 1 charge stuff
//damage = 5;
//this->Data = whatever;
}
if (powLev >= 10 && powLev < 20)
{
//do level 2 charge stuff here
}
if (powLev > 20)
{
//do lev 3 charge stuff here
}
}

This is a quick mockup code, don't expect that it is 100&#37; accurate syntax, that should give you basic idea
oh and Never be sorry for asking too many questions and wanting to learn. Learning is the greatest thing we can do in life 😊

BigJoe wanted me to write a script which randomly places 8 enemies on the screen. Here it is:


bool is_walkable(int x, int y)
{
return Screen->ComboS[x+y*16]==0;
}

ffc script test {
void run(int e1, int e2, int e3, int e4, int e5, int e6, int e7, int e8) {
putenemy(e1);
putenemy(e2);
putenemy(e3);
putenemy(e4);
putenemy(e5);
putenemy(e6);
putenemy(e7);
putenemy(e8);
}

void putenemy(int eid)
{
//to do this properly we really need priority queues in ZScript 😉

int x = Rand(16);
int y = Rand(11);
while(!is_walkable(x,y))
{
x = Rand(16);
y = Rand(11);
}
npc en = Screen->CreateNPC(eid);
if(en->isValid())
{
en->X = x*16;
en->Y = y*16;
}
//simulate staggered spawning
Waitframe();
}
}

Thanks, DarkDragon! Here is the latest version. All that really needs to be done is a random enemy limit. Handle up on it, anyone?

bool is_walkable(int x, int y)
{
return Screen->ComboS[x+y*16]==0;
}

ffc script enemonger {

void run(int e1, int e2, int e3, int e4, int e5, int e6, int e7, int e8) {

int chosenid;
int randval = Rand(8);

if(randval == 0) {chosenid=e1;
int randval = Rand(8);
}else if(randval == 1) {chosenid=e2;
int randval = Rand(8);
}else if(randval == 2) {chosenid=e3;
int randval = Rand(8);
}else if(randval == 3) {chosenid=e4;
int randval = Rand(8);
}else if(randval == 4) {chosenid=e5;
int randval = Rand(8);
}else if(randval == 5) {chosenid=e6;
int randval = Rand(8);
}else if(randval == 6) {chosenid=e7;
int randval = Rand(8);
}else if(randval == 7) {chosenid=e8;
int randval = Rand(8);
}


putenemy(chosenid);
putenemy(chosenid);
putenemy(chosenid);
putenemy(chosenid);
putenemy(chosenid);
putenemy(chosenid);
putenemy(chosenid);
putenemy(chosenid);
}

void putenemy(int eid)
{
//to do this properly we really need priority queues in ZScript 😉

int x = Rand(16);
int y = Rand(11);
while(!is_walkable(x,y))
{
x = Rand(16);
y = Rand(11);
}
npc en = Screen->CreateNPC(eid);
if(en->isValid())
{
en->X = x*16;
en->Y = y*16;
}
//simulate staggered spawning
Waitframe();
}
}

Ahhh, I see Bigjoe beat me to it. But here is the Random version!! 😃
EDIT: Ah, it's pretty much the same thing....I used en_count as the cap though, feel free to change it to whatever you want.

int en_count = 8;

just change 8 to 100! ....or something else, it's up to you. 😃

//====================================================
// D0-D7; Enemies that might spawn,
// <in Addition to boss or any other enemies set to screen enemies> 😉
// Thanks to DarkDragon! :=D
//====================================================
bool is_walkable(int x, int y)
{
return Screen->ComboS[x+y*16]==0;
}

ffc script random_enemy_maker {
void run(int e1, int e2, int e3, int e4, int e5, int e6, int e7, int e8) {
int RandNum = Rand(8);
int en_count = 8;
while(en_count > 0){

if (RandNum == 0){
putenemy(e1);
} if (RandNum == 1){
putenemy(e2);
} if (RandNum == 2){
putenemy(e3);
} if (RandNum == 3){
putenemy(e4);
} if (RandNum == 4){
putenemy(e5);
} if (RandNum == 5){
putenemy(e6);
} if (RandNum == 6){
putenemy(e7);
} if (RandNum == 7){
putenemy(e8);
}
en_count = en_count - 1;
RandNum = Rand(8);

}

}

void putenemy(int eid)
{
//to do this properly we really need priority queues in ZScript 😉

int x = Rand(16);
int y = Rand(11);
while(!is_walkable(x,y))
{
x = Rand(16);
y = Rand(11);
}
npc en = Screen->CreateNPC(eid);
if(en->isValid())
{
en->X = x*16;
en->Y = y*16;
}
//simulate staggered spawning
Waitframe();
}
}

I just tested it too, it's freakin awesome BigJoe. There's no way you can not use this. 😉

And DarkDragon that is freaking amazing. Do you realize what you've just done??? ,You've inadvertantly created freeform bosses!!! Check out a couple pics.

User posted image
User posted image

I have almost finished a demo dungeon with random doors(and now random enemies)...Sweet. Also this awesome script deserves to be in showcase, whatdya think?

Use e8 for the enemy counter, and let e1 through e7 do the work, and it works much better XD

bigjoe wrote:Use e8 for the enemy counter, and let e1 through e7 do the work, and it works much better XD

I'm not following. Can you post the script? It was working great for me, completely random.

[FONT=monospace]int en_count = e8;

Then you can tell the SCREEN how many enemies you want. I already accidentally did 80, and it was trippy. You had to kill them in droves just to stay alive. 😃

Then shave out the if (RandNum == 7) part and change the Rands to 7[/FONT]

Oh right...I didn't do that because it would require more setup, plus I figured 18 enemies on a screen would be enough..lol!...But knowing me I would of made a variant for that eventually. hehe.

Anyways check this one out. ver2.0
Now with more doors. Again with this one if you F6 doors, they will be unaffected. 😉

Enjoy!


//------------------------------------------------------
// Creates 1-3 closed shutters in a random direction as
// long as there is a wall.-along with a one-way wherever link enters from.
// Once the enemies have been killed the shutter will open.
// This will not overwrite essential doors added for specific
// dungeon map layouts 😊
// Not used yet/ -random locked doors, boss doors, open doors-
//------------------------------------------------------

ffc script random_door_generator{ //ver2.0

void run(){

int RandNum = Rand(4);

if (Link->Dir == 0 && Screen->Door[DIR_DOWN] == D_WALL){
Screen->Door[DIR_DOWN] = D_1WAYSHUTTER;
} if (Link->Dir == 1 && Screen->Door[DIR_UP] == D_WALL){
Screen->Door[DIR_UP] = D_1WAYSHUTTER;
} if (Link->Dir == 2 && Screen->Door[DIR_RIGHT] == D_WALL){
Screen->Door[DIR_RIGHT] = D_1WAYSHUTTER;
} if (Link->Dir == 3 && Screen->Door[DIR_LEFT] == D_WALL){
Screen->Door[DIR_LEFT] = D_1WAYSHUTTER;

} if (RandNum == 0 && Screen->Door[DIR_DOWN] == D_WALL){
Screen->Door[DIR_DOWN] = D_SHUTTER;
} if (RandNum == 0 && Screen->Door[DIR_UP] == D_WALL){
Screen->Door[DIR_UP] = D_SHUTTER;
} if (RandNum == 1 && Screen->Door[DIR_RIGHT] == D_WALL){
Screen->Door[DIR_RIGHT] = D_SHUTTER;
} if (RandNum == 1 && Screen->Door[DIR_LEFT] == D_WALL){
Screen->Door[DIR_LEFT] = D_SHUTTER;
} if (RandNum == 2 && Screen->Door[DIR_DOWN] == D_WALL){
Screen->Door[DIR_DOWN] = D_SHUTTER;
} if (RandNum == 2 && Screen->Door[DIR_UP] == D_WALL){
Screen->Door[DIR_UP] = D_SHUTTER;
} if (RandNum == 2 && Screen->Door[DIR_RIGHT] == D_WALL){
Screen->Door[DIR_RIGHT] = D_SHUTTER;
} if (RandNum == 3 && Screen->Door[DIR_LEFT] == D_WALL){
Screen->Door[DIR_LEFT] = D_SHUTTER;
} if (RandNum == 3 && Screen->Door[DIR_RIGHT] == D_WALL){
Screen->Door[DIR_RIGHT] = D_SHUTTER;
} if (RandNum == 3 && Screen->Door[DIR_UP] == D_WALL){
Screen->Door[DIR_UP] = D_SHUTTER;

}
}
}

Also---Uh-oh. Bugs.. How do we keep the enemies within the walls on the enemy script? Apparently Doors were not accounted for.

User posted image

Maybe some kind of x32, y32, perimeter?? Idea's?

Just solidify the "beyond" combos on the Door Combo Sets. Like the combos that are BEHIND The shutter. thats how I fixed it 😉

Right. I suppose you couldn't use this on a screen with open or unlocked doors then. Well that's not so bad.

I also have another question for someone to answer:

Or statement;
if (milk += funny == true){
nose x16milk l l nose y16milk l l Link->Die;

Which one of these runs? x16, y16, or dies? or am I using this wrong?.....
Howabout;
if (Link->MP >=16 l l Link->HP >= 16){
Link happy;

This makes more sense, but would the first one be random?....

Well, I should have put it this way:

Copy the Beyond tiles to another location in the combo sheet and solidify them. Switch the ones for the SHUTTER DOORS only to those.

Or statement;
if (milk += funny == true){
nose x16milk l l nose y16milk l l Link->Die;

oh yeah, sorry the || statement does not work that way. it is for comparisons only (if statements, while loops, etc)


void putenemy(int eid)
{
//to do this properly we really need priority queues in ZScript 😉
int x = Rand(12)+2;
int y = Rand(7)+2;
while(!is_walkable(x,y))
{
x = Rand(12)+2;
y = Rand(7)+2;
}

Replace that code, it should keep the enemies from spawning inside the outter walls.

Sweet, i'll do that. 😊 thanks.

Also got another one.

//==============================================================================
// FFC SCRIPT DMAP PITWARP
// D0 -probability of warp minus 50%. To chance warp every 16 screens, set to 8.
// D1 Dmap destination
// D2 No need to set this
//==============================================================================
ffc script Dmap_Pit{

void run (int shit, int dung, int me){

int damn = Rand(shit);
me = Rand(116);
if (damn == 0){
if ((me == 00 || me == 01 || me == 02 || me == 03 ||
me == 04 || me == 05 || me == 06 || me == 07) ||
(me == 10 || me == 11 || me == 12 || me == 13 ||
me == 14 || me == 15 || me == 16 || me == 17) ||
(me == 20 || me == 21 || me == 22 || me == 23 ||
me == 24 || me == 25 || me == 26 || me == 27) ||
(me == 30 || me == 31 || me == 32 || me == 33 ||
me == 34 || me == 35 || me == 36 || me == 37) ||
(me == 40 || me == 41 || me == 42 || me == 43 ||
me == 44 || me == 45 || me == 46 || me == 47) ||
(me == 50 || me == 51 || me == 52 || me == 53 ||
me == 54 || me == 55 || me == 56 || me == 57) ||
(me == 60 || me == 61 || me == 62 || me == 63 ||
me == 64 || me == 65 || me == 66 || me == 67) ||
(me == 70 || me == 71 || me == 72 || me == 73 ||
me == 74 || me == 75 || me == 76 || me == 77)
){ Link->PitWarp(dung,me);
}
}
}
}

As you can see I tried to get around the "can warp outside the 8x8 Dmap grid" to no avail. Someone please tell me all those aren't being transformed into hexidecimals.....for the love of god..why..:mad😞angry face.)

One question; Why the hell is Zscript warp so difficult to work with?


ffc script Dmap_Pit{

void run (int shit, int dung, int me){

int damn = Rand(shit);
me = Rand(0x74);
if (damn == 0 && me >= 0x00 && me <= 0x4D) {Link->PitWarp(dung,me);}
}
}


Try that, I think it will work
if you are wondering what all the 0x stuff is about that is just telling C, ur i mean ZScript, that it is a hex number.

Nice varible names btw 😛

One question; Why the hell is Zscript warp so difficult to work with?

its not if you understand hex, it is probley eaiser on the devs to have the screen numbers use hex

You're under no obligation to use hex, warping to screen 0x10 is the same as warping to screen 16.

Script warps work the same as ordinary, eg side or tile, warps. You give the dmap and a screen offset from the start of that dmap. You can't leave the 8x8 curtain because the dmap only encompasses 64 screens.

okay I get what gleeok's problem is now (duh) yea its a Dmap thing so just place two DMaps next to each other and randomly switch between Dmaps then you have a 16x16 map, with good disign it will be transparent to the palyer.