Jump to content

Photo

I have some stuff I'd like help with


  • Please log in to reply
34 replies to this topic

#1 Eragon615

Eragon615

    Junior

  • Members
  • Real Name:Clayton
  • Location:Texas

Posted 18 July 2010 - 09:52 PM

Let me start with some questions, then I'll ask for help with the actual scripting part as I need it.

First question: I recently upgraded to the absolute newest build for windows. In the list of added features I noticed a SetSideWarp and a SetTileWarp. Sounds to me like that means I can control warps with scripting. Am I right and how do they work? (I checked zscript.txt but couldn't find them)

Next set of questions: While skimming zscript.txt for my previous question, I noticed DrawCircle, which loosed a stream of ideas. If I were to make a ffc script that drew a black rectangle over the entire screen, then made a transparent circle on the same layer around link, would that work like the dark rooms in LttP?
For the level one candle, you can only use the candle once per screen. I want to change it's graphic when you use it. Can I detect if it's been used on a screen and change it's graphic with script?

Obviously I'm working on the dark section of my quest, lol.

#2 Wolfman2000

Wolfman2000

    Doyen(ne)

  • Members
  • Location:Atlanta, Georgia

Posted 18 July 2010 - 11:18 PM

For SetTileWarp, I made a quick script example of how it would work using an FFC. It should be in the submitted scripts section. I basically changed a warp's destination based on an item in Link's inventory. There are probably other ways of doing it, but it's best to start with a simple example.

#3 Eragon615

Eragon615

    Junior

  • Members
  • Real Name:Clayton
  • Location:Texas

Posted 18 July 2010 - 11:41 PM

Awesome, the warps work the way I thought. I think I've got enough script in me to create a blanket effect with the ffc to cover the entire screen with, just needed to know what the commands inside the () were. Thanks alot!

Edited by Eragon615, 18 July 2010 - 11:41 PM.


#4 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 19 July 2010 - 05:03 AM

QUOTE(Eragon615 @ Jul 18 2010, 07:52 PM) View Post


Next set of questions: While skimming zscript.txt for my previous question, I noticed DrawCircle, which loosed a stream of ideas. If I were to make a ffc script that drew a black rectangle over the entire screen, then made a transparent circle on the same layer around link, would that work like the dark rooms in LttP?


No. icon_frown.gif

I know it should be easy to do but it isn't. Here's how I would do it:

Step 1; Draw(*rip*) an inverted circle in the tile pages.
Step 2; Draw it centered on Link using Screen->DrawTile();
Step 3; Draw 4 black rectangles around the edges using Screen->Rect();

#5 Eragon615

Eragon615

    Junior

  • Members
  • Real Name:Clayton
  • Location:Texas

Posted 19 July 2010 - 09:01 AM

Well, at least it's possible, albeit slightly difficult... I'll give it a try and see what I can manage. Last for now is the candle editing questions, that is, can I alter the graphic while it is in the used for this screen state.

#6 Joe123

Joe123

    Retired

  • Members

Posted 20 July 2010 - 08:24 PM

I also put one in the database, but Gleeok doesn't like it =(

#7 Eragon615

Eragon615

    Junior

  • Members
  • Real Name:Clayton
  • Location:Texas

Posted 21 July 2010 - 12:28 AM

One already made would save me a whole lot of time, my scripts tend to develop extremely slowly, and I procrastinate writing them as well. Only trouble is I can't find it. Is it AGN, or did I just miss it even though I checked thrice? Link please?

#8 trudatman

trudatman

    one point nine hero

  • Members
  • Real Name:that guy
  • Location:State Of Love And Trust, The United State Of Amorica.

Posted 21 July 2010 - 12:56 AM

what is an inverted circle? trying to fathom that concept. not working.

#9 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 21 July 2010 - 01:01 AM

An 'inverted' circle is when everything but the circle is drawn upon, thus the circle is the only thing "not drawn"... so it's like the opposite of drawing a circle. ..yeah. icon_biggrin.gif


Here it is: http://www.purezc.co...showtopic=44846


PS: I never said I didn't like it, I just said I would have used triangles instead. icon_razz.gif

Edited by Gleeok, 21 July 2010 - 01:02 AM.


#10 Eragon615

Eragon615

    Junior

  • Members
  • Real Name:Clayton
  • Location:Texas

Posted 21 July 2010 - 01:33 PM

Oh, I missed it because I ignored the meathods. *facepalm* I actually thought of trying that, but this will save me days. Someone should include artistic math; that is, something like:

DrawRectangle - DrawCircle.

Haha. Okay, only my candle graphic question. I actually wanna re-script my two candles anyway. I'll leave more details when I get to my computer and off my phone.

#11 Joe123

Joe123

    Retired

  • Members

Posted 21 July 2010 - 01:46 PM

DrawRectangle and DrawCircle are a part of ZC already.

#12 Eragon615

Eragon615

    Junior

  • Members
  • Real Name:Clayton
  • Location:Texas

Posted 21 July 2010 - 02:06 PM

No no, I meant drawrectangle minus drawcircle. You follow? For more complex shapes.

#13 Joe123

Joe123

    Retired

  • Members

Posted 21 July 2010 - 02:08 PM

Not really following. You mean something like a circle with a rectangle cut out of it?
Gleeok'd tell you better than myself, but I think those sort of things are done better on a more situation-specific level and using triangles rather than scanlines, which I don't know how to do.

#14 Eragon615

Eragon615

    Junior

  • Members
  • Real Name:Clayton
  • Location:Texas

Posted 21 July 2010 - 02:50 PM

Oh, well in that case, Gleeok, I might be PMing you later to discuss how that works. I'm at home on my compy now so I can go into detail.

What I meant was if I used DrawRectangle to make a rectangle around Link then subtracted a DrawCircle on top of him I'd get a black rectangle with a hole in it. Or a large circle with a smaller circle subtracted to make a cresent moon shape. But anyway, it's irrelevant.

Now, about those examples of what I'm trying to do, here's some example situations.:

1) Link walks into a dark room and only has a small circle that he bearly fits inside of for visibility.

2)Same room but Link has the candle in his possession. The circle of visibility is much larger. Same for the lantern (candle 2).

3) Link uses the candle. I want to change from a fireball moving forward lowly to a quick flash of flame. I can manage that on my own. During the half second or so the screen is illuminated. After use, the candle's GFX is changed to a candle that is unlit, until he changes screens where the candle is re-lit. If special FFCs are burned, they light up and illuminate the screen. If the candle has been used and is unlit, the circle of light should return to the smaller size.

4) The lantern should behave like the red candle. Same custom fire behaivor of a quick flash instead of a huge fireball, but reusable and stays lit.

I think I know how to work most of this, but if anyone would like to help, I'm still very slow at scripting, and my grammar is terrible. Plus many of you probably know shortcuts to help. Please offer those as well. Please and thank you.

#15 Joe123

Joe123

    Retired

  • Members

Posted 21 July 2010 - 03:17 PM

Ohhh right, rectangle with circle cut out.
CODE
void InvertedCircle(int l, int bx1, int by1, int bx2, int by2, int cx, int cy, int r, int c, int o)
{
    Screen->Rectangle(l,bx1,by1,bx2,cy-r,c,1,0,0,0,true,o);
    Screen->Rectangle(l,bx1,cy+r,bx2,by2,c,1,0,0,0,true,o);
    int usedy = y-r;
    for(int i=-90;i>-270;i-=0.5)
    {
        int cy = y+r*Sin(i);
        if(usedy == Floor(cy)) continue;
        Screen->Line(l,0,cy,x+r*Cos(i),cy,c,1,0,0,0,o);
        Screen->Line(l,256,cy,x+r*Cos(i+180),cy,c,1,0,0,0,o);
        usedy = Floor(cy);
    }
}
Try that. Inputs are as before, except there are four integers specifying a rectangle before the circle's centre.
I didn't put bounds checking for if you put the circle not inside the rectangle or strange things like that, so don't do those things because they just won't work at all.

The best way to make a moon would be to draw one on the tilesheet, then use the scaling parameters of drawtile to blow it up to the right size.

The first two would just be inverted circle with the radius different each time, that'd be really easy.

OK well all of those things are possible (and not too hard).

Yeah, you want to make it a completely custom item and ditch ZC's candle interface, it's a bit crappy anyway.
You're after something like the flame lantern from TMC right?

If you post up how you're planning on making it work I can help you along.


The only thing I would say is that when Link scrolls between screens, whatever you do (currently) everything is going to look crap. Try drawing an inverted circle over Link with a radius of about 32px with global slot two and then swapping screens; it looks horrendous.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users