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. :D
Then shave out the if (RandNum == 7) part and change the Rands to 7
Printable View
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. :D
Then shave out the if (RandNum == 7) part and change the Rands to 7
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!
Code://------------------------------------------------------
// 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.
http://www.mediafire.com/imgbnc.php/...8f2e3aa84g.jpg
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.
oh yeah, sorry the || statement does not work that way. it is for comparisons only (if statements, while loops, etc)Quote:
Or statement;
if (milk += funny == true){
nose x16milk l l nose y16milk l l Link->Die;
Replace that code, it should keep the enemies from spawning inside the outter walls.Code: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;
}
Sweet, i'll do that. :) thanks.
Also got another one.
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.)Code://==============================================================================
// 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);
}
}
}
}
One question; Why the hell is Zscript warp so difficult to work with?
Try that, I think it will workCode: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);}
}
}
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 :p
its not if you understand hex, it is probley eaiser on the devs to have the screen numbers use hexQuote:
One question; Why the hell is Zscript warp so difficult to work with?
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.