Jump to content

Photo

um... Noobie need help!!


  • Please log in to reply
167 replies to this topic

#121 Joe123

Joe123

    Retired

  • Members

Posted 08 May 2008 - 05:19 PM

I've always wondered that.

I'd love it if you could find out =P

#122 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 08 May 2008 - 05:55 PM

Heh. Alright. I'll try.

#123 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 08 May 2008 - 06:38 PM

i think effect width and height are a radius thing, except it is using a quadrillateral instead of a circle.

#124 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 08 May 2008 - 06:54 PM

I hope so. That'll make things alot easier.

And, here's my 'Poison Cloud' script I've come up with (so far):
CODE
import "std.zh"

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? icon_confused2.gif

Edited by AgentLym, 08 May 2008 - 06:55 PM.


#125 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 08 May 2008 - 07:45 PM

heh... you would have to make it check for solidity.

check the zscript.txt and the std.zh to figure it out. should be something like IsWalkable or something like that.

#126 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 08 May 2008 - 09:03 PM

Why would I have to do that? I set the FFC to check to see if it's X and Y values were near the edge of the screen...

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 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 08 May 2008 - 09:15 PM

then say something like

CODE
if the cloud is near these coordinates
  then change the interger "cloud_dir" to this number


that way, you could reverse its speed and movement and stuff.

#128 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 08 May 2008 - 09:19 PM

That's what I did... At least, I think that's what I did.

I'm pretty sure I did what I think I did which you think I should do. (but, I already did icon_razz.gif )

Look at my script again so you can see what I did.

=====EDIT=====

Oh my goodness... I forgot the while() loop. My bad! icon_razz.gif

Edited by AgentLym, 08 May 2008 - 09:26 PM.


#129 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 08 May 2008 - 09:30 PM

yes, but that tells it to go in a random direction again. (returns to 0 and then becomes random again)

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 Joe123

Joe123

    Retired

  • Members

Posted 09 May 2008 - 02:06 AM

QUOTE(Master Maniac @ May 9 2008, 12:38 AM) View Post

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 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 09 May 2008 - 06:34 AM

QUOTE
yes, but that tells it to go in a random direction again. (returns to 0 and then becomes random again)

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!

QUOTE
Quadralaterals don't have radii, only circles...


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 icon_razz.gif )

Edited by AgentLym, 09 May 2008 - 06:34 AM.


#132 Joe123

Joe123

    Retired

  • Members

Posted 09 May 2008 - 07:16 AM

Oh >_<

Well that makes a little more sense.
You still can't say that quadrlaterals have radii though ¬_¬

#133 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 09 May 2008 - 02:24 PM

QUOTE
You still can't say that quadrlaterals have radii though ¬_¬


Heh. Yeah... I know. icon_heh.gif

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 icon_heh.gif )
CODE
this->Effect = Link->HP-1;

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. icon_razz.gif

====EDIT 3====

Here is my almost perfect poison cloud code!
CODE
import "std.zh"

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.... icon_sweat.gif
But at least it's long and looks complicated! (to the beginner icon_razz.gif ))

Edited by AgentLym, 09 May 2008 - 05:09 PM.


#134 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 10 May 2008 - 12:24 AM

wow. impressive lol.

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 Joe123

Joe123

    Retired

  • Members

Posted 10 May 2008 - 06:07 AM

Ah the joys of scripting with lots of if statements and no maths =P


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