Jump to content

Photo

Just a very simple question.


  • Please log in to reply
5 replies to this topic

#1 ShadowTiger

ShadowTiger

    The Doctor Is In

  • Members

Posted 26 December 2007 - 08:42 PM

A simple question regarding cloning Freeform Combos via scripting.

Suppose I wanted to create a droplet like the one in Radien's DoR tileset. It falls from the ceiling and makes a splash at a certain point. Suppose I had one FFC to work with, but wanted many droplets onscreen. When the droplet reaches a certain point, its graphics change to that of a splash, and it stops moving. It then exhausts its graphics, and goes back to its original falling point to repeat its long journey to the ground.

Your basic droplet.

Is it possible to use only that one Freeform Combo along with a script to have multiple copies of the same droplet visible at the same time in varying areas of the screen? In other words, can the same Freeform combo be in more than one place at a time onscreen? Like, can I spawn it here, here, and here, all with one script?

#2 TetriTek

TetriTek

    Wizard

  • Members
  • Real Name:Joshua Johnson
  • Location:Clinton

Posted 26 December 2007 - 08:54 PM

I dont know, never thought about doing that, I guess it could be possible... but i dont know how to go about doing it...



#3 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

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

Posted 27 December 2007 - 06:04 AM

QUOTE(ShadowTiger @ Dec 26 2007, 07:42 PM) View Post

A simple question regarding cloning Freeform Combos via scripting.

Suppose I wanted to create a droplet like the one in Radien's DoR tileset. It falls from the ceiling and makes a splash at a certain point. Suppose I had one FFC to work with, but wanted many droplets onscreen. When the droplet reaches a certain point, its graphics change to that of a splash, and it stops moving. It then exhausts its graphics, and goes back to its original falling point to repeat its long journey to the ground.

Your basic droplet.


Yes, basically.

QUOTE

Is it possible to use only that one Freeform Combo along with a script to have multiple copies of the same droplet visible at the same time in varying areas of the screen? In other words, can the same Freeform combo be in more than one place at a time onscreen? Like, can I spawn it here, here, and here, all with one script?



Can one combo be in more than one place at a time? Unfortunately, no. But we can make it so indirectly. The ffc won't be used to draw water, the script will do that. If you do that we might as well make the droplets appear at random locations too. icon_smile.gif just for fun.

Solution #1;

int tile = "insert tile number here";
int og = tile;
int offset = "animation frames here...in tile end number";
while("loop here"){
int x = Rand(200)+20;
int y = Rand(100);
int splash = y;
while(splash<y+64){
if(tile>offset)tile = og;
Screen->DrawTile(5,x,y,tile,1,1,5,0,0,0,0,0,false,128);
y++;

****, gotta go..uhh, number 2 is basically using combo aliases to set up droplets..much easier, silly head. icon_wink.gif


#4 C-Dawg

C-Dawg

    Magus

  • Members

Posted 27 December 2007 - 11:24 AM

Yes, this is possible. An FFC script can display graphics in one of two ways.

First, you can change the combo of the FFC directly. As I understand, this method is quicker and leads to less slowdown. If you're sticking with this, you cant have on FFC in multiple location at the same time. But you CAN have the FFC complete it's droplet movement and animation, then immediately go somewhere else on the screen and start it all over again.

Second, you can use the draw functions to draw tiles directly on the screen. This method is more processor intensive, I hear. Using this method, you can have as many droplets as you want going at once, but the code is more complicated (you need variable stand-ins for things FFCs do naturally, like ->X and ->Y.) and it might cause slowdown if you're drawing alot of them.



#5 ShadowTiger

ShadowTiger

    The Doctor Is In

  • Members

Posted 27 December 2007 - 02:31 PM

Thank you! (Both.) That's quite close enough. I'll be sticking with the Graphics change, then teleportation of the FFC.

#6 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

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

Posted 28 December 2007 - 12:14 AM

Sorry, I didn't get to finish my post, but using the recycled ffc is similar to draw functions but easier. You simply set the X and Y, increment Y as much as you want then stop incrementing Y and switch the ffc->Data to the splash animation. When that's done just rise and repeat..no pun intended....

So, this mean you are scripting now?


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users