um... Noobie need help!!
#121
Posted 08 May 2008 - 05:19 PM
I'd love it if you could find out =P
#122
Posted 08 May 2008 - 05:55 PM
#123
Posted 08 May 2008 - 06:38 PM
#124
Posted 08 May 2008 - 06:54 PM
And, here's my 'Poison Cloud' script I've come up with (so far):
ffc script poison_cloud{
void run(int tile_rows, int tile_cols, int hurt_radius, int cloud_speed, int center_cloud_combo){
int cloud_dir = Rand(16);
if(cloud_dir == 0){
cloud_dir = Rand(16);
this->Vx = 0;
this->Vy = 0;
}
if(cloud_dir == 1){
this->Vx = 0;
this->Vy = .8;
}
if(cloud_dir == 2){
this->Vx = .2;
this->Vy = .6;
}
if(cloud_dir == 3){
this->Vx = .4;
this->Vy = .4;
}
\\Etc, etc, etc.......
if(cloud_dir == 16){
this->Vx = -.2;
this->Vy = .6;
}
else if(this->X == 0 || this->Y == 0 || this->X == 240 || this->Y == 160){ \\These are the lines
cloud_dir = 0; \\that are supposed to
this->Vx = 0; \\stop the cloud and
this->Vy = 0; \\choose a different direction
} \\(actually performed at the
Waitframe(); \\top of the script)
}
}
You may be wondering why I showed you this. Well, I need help.
The poison cloud moves ok, but when it hits a wall, it's supposed to stop and go a random different direction.
BUT, instead of stopping, the cloud just keeps on going and leaves the screen...
How would I fix that?
Edited by AgentLym, 08 May 2008 - 06:55 PM.
#125
Posted 08 May 2008 - 07:45 PM
check the zscript.txt and the std.zh to figure it out. should be something like IsWalkable or something like that.
#126
Posted 08 May 2008 - 09:03 PM
I don't mind if the cloud goes through solid combos. I just want to know why it doesn't stop anyway... I mean, I set it to stop (as noted by the tags in the code) when it's X is next to either the left or right side or the Y is next to the top or bottom...
Any help?
Edited by AgentLym, 08 May 2008 - 09:05 PM.
#127
Posted 08 May 2008 - 09:15 PM
then change the interger "cloud_dir" to this number
that way, you could reverse its speed and movement and stuff.
#128
Posted 08 May 2008 - 09:19 PM
I'm pretty sure I did what I think I did which you think I should do. (but, I already did
Look at my script again so you can see what I did.
=====EDIT=====
Oh my goodness... I forgot the while() loop. My bad!
Edited by AgentLym, 08 May 2008 - 09:26 PM.
#129
Posted 08 May 2008 - 09:30 PM
so ypu need one for if it hits the top, then it changes direction to move downward, and the same for the rest of the sides. i would do it individualy, though
#130
Posted 09 May 2008 - 02:06 AM
i think effect width and height are a radius thing, except it is using a quadrillateral instead of a circle.
Quadralaterals don't have radii, only circles...
'A shape with a constant radius' is the definition of a circle.
Quadralaterals don't fit this definition.
What are you on about =P
#131
Posted 09 May 2008 - 06:34 AM
Yeah. I switched the while() loop so that it would be right underneath the void run(). Then, I had to fix the last part a bit.
Now, it works pretty well! But, I'm wondering if I should do 32 directions instead of 16... I think I will.
Thanks for the help, MM!
Yeah. You're right. But I think I get what MM means. It would be like my Example code I made a little while back. A FFC with a effect height and width of 3 would be like the second example. (at least, I think that's what MM means
Edited by AgentLym, 09 May 2008 - 06:34 AM.
#132
Posted 09 May 2008 - 07:16 AM
Well that makes a little more sense.
You still can't say that quadrlaterals have radii though ¬_¬
#133
Posted 09 May 2008 - 02:24 PM
Heh. Yeah... I know.
Now to get back to making my cloud hurt Link...
====EDIT====
Well, I've figured out a few things. One, a FFC's TileWidth and TileHeight functions go out to the right and down from the FFC. (Also, they use the tiles, not combos)
Now, I'm trying to figure out EffectHeight and EffectWidth. But, another problem. I've looked at the Wiki, std.zh, and zscript.txt but haven't found the answer I'm looking for...
How would you make Link get hurt when touching a FFC? Like this? (Sorry if I sound lazy
or
if(Link->X == this->X){
Link->HP = Link->HP-1;
Am I right...?
====EDIT 2====
Forget it. The effect is actually the effect of the combo the FFC uses. Stupid me!
AND, I think that EffectWidth and Effect Height goes right and down from the FFC, just like the TileWidth and Height.
====EDIT 3====
Here is my almost perfect poison cloud code!
ffc script poison_cloud{
void run(int tile_rows, int tile_cols, int width_effect, int height_effect){
int cloud_dir = Rand(32);
while(true){
this->EffectHeight = height_effect;
this->EffectWidth = width_effect;
this->TileHeight = tile_rows;
this->TileWidth = tile_cols;
if(cloud_dir == 0){
cloud_dir = Rand(16);
this->Vx = 0;
this->Vy = 0;
}
if(cloud_dir == 1){
this->Vx = 0;
this->Vy = .8;
}
if(cloud_dir == 2){
this->Vx = .2;
this->Vy = .6;
}
if(cloud_dir == 3){
this->Vx = .4;
this->Vy = .4;
}
if(cloud_dir == 4){
this->Vx = .6;
this->Vy = .2;
}
if(cloud_dir == 5){
this->Vx = .8;
this->Vy = 0;
}
if(cloud_dir == 6){
this->Vx = .6;
this->Vy = -.2;
}
if(cloud_dir == 7){
this->Vx = .4;
this->Vy = -.4;
}
if(cloud_dir == 8){
this->Vx = .2;
this->Vy = -.6;
}
if(cloud_dir == 9){
this->Vx = 0;
this->Vy = -.8;
}
if(cloud_dir == 10){
this->Vx = -.2;
this->Vy = -.6;
}
if(cloud_dir == 11){
this->Vx = -.4;
this->Vy = -.4;
}
if(cloud_dir == 12){
this->Vx = -.6;
this->Vy = -.2;
}
if(cloud_dir == 13){
this->Vx = -.8;
this->Vy = 0;
}
if(cloud_dir == 14){
this->Vx = -.6;
this->Vy = .2;
}
if(cloud_dir == 15){
this->Vx = -.4;
this->Vy = .4;
}
if(cloud_dir == 16){
this->Vx = -.2;
this->Vy = .6;
}
if(cloud_dir == 17){
this->Vx = .1;
this->Vy = .7;
}
if(cloud_dir == 18){
this->Vx = .3;
this->Vy = .5;
}
if(cloud_dir == 19){
this->Vx = .5;
this->Vy = .3;
}
if(cloud_dir == 20){
this->Vx = .7;
this->Vy = .1;
}
if(cloud_dir == 21){
this->Vx = -.7;
this->Vy = -.1;
}
if(cloud_dir == 22){
this->Vx = -.5;
this->Vy = -.3;
}
if(cloud_dir == 23){
this->Vx = -.3;
this->Vy = -.5;
}
if(cloud_dir == 24){
this->Vx = -.1;
this->Vy = -.7;
}
if(cloud_dir == 25){
this->Vx = .7;
this->Vy = -.1;
}
if(cloud_dir == 26){
this->Vx = .5;
this->Vy = -.3;
}
if(cloud_dir == 27){
this->Vx = .3;
this->Vy = -.5;
}
if(cloud_dir == 28){
this->Vx = .1;
this->Vy = -.7;
}
if(cloud_dir == 29){
this->Vx = -.1;
this->Vy = .7;
}
if(cloud_dir == 30){
this->Vx = -.3;
this->Vy = .5;
}
if(cloud_dir == 31){
this->Vx = -.5;
this->Vy = .3;
}
if(cloud_dir == 32){
this->Vx = -.7;
this->Vy = .1;
}
if(this->X <= -16){
cloud_dir = 0;
this->Vx = 0;
this->Vy = 0;
this->X = this->X+1;
}
if(this->Y <= -16){
cloud_dir = 0;
this->Vx = 0;
this->Vy = 0;
this->Y = this->Y+1;
}
if(this->X >= 224){
cloud_dir = 0;
this->Vx = 0;
this->Vy = 0;
this->X = this->X-1;
}
if(this->Y >= 144){
cloud_dir = 0;
this->Vx = 0;
this->Vy = 0;
this->Y = this->Y-1;
}
Waitframe();
}
}
}
Just set the FFC combo used to hurt Link 1+ hearts, and put multiple clouds in a screen with limited walking space, and you've got yourself a tough room! (especially in a room filled with your (Joe123's) lava and pit script!
I know it's long, but at least its organized!
Next, a Paralyze Cloud!
A cloud that freezes Link, making him vulnerable to enemies and poison clouds! The perfect FFC for a boss room!
(Keep in mind this is just my third script. I know it's not the most complicated script ever....
But at least it's long and looks complicated! (to the beginner
Edited by AgentLym, 09 May 2008 - 05:09 PM.
#134
Posted 10 May 2008 - 12:24 AM
my first few script attempts were crappy and overcomplicated bosses.
they dont work right though XD
this would work great in a boss or puzzle room though...
i was going to say something else but i forgot. eh.
#135
Posted 10 May 2008 - 06:07 AM
I don't see why it shouldn't bounce off again, your code looks ok (although rather overly complex).
I did have a try at making it more simple, but I really don't have the patience.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


