PDA

View Full Version : Some Questions



Mega Link
01-24-2008, 08:40 PM
How do you get ffcs to move?
How do you get ffcs to move when pressing the directional buttons?
How do you make things happen when an ffc touches Link or another ffc?
How do you make Link invisible?
How do you force enemies to target another ffc?
How do you draw text on a screen?
How do you draw a 2x2 frame on a screen?
How do you highlight and change the color of existing text?

Joe123
01-24-2008, 08:52 PM
How do you get ffcs to move?
How do you get ffcs to move when pressing the directional buttons?
How do you make things happen when an ffc touches Link or another ffc?
How do you make Link invisible?
How do you force enemies to target another ffc?
How do you draw text on a screen?
How do you draw a 2x2 frame on a screen?
How do you highlight and change the color of existing text?

Oooo, you're going to do it yourself?

Very good ^_^

Right.

How do you get ffcs to move?
To make ffcs move, what you do is set their Vx and Vy values (X and Y velocity).

If you want to make the ffc you have the script applied to move, it has it's own pointer loaded up automatically, so you do it like this:

this->Vx = 1;
this->Vy = 1;

However, if you want to load a different ffc, and make that move (you might want to note this cause it could be important for later):

ffc ffcnamegoeshere = Screen->LoadFFC(whatever number the ffc is you're loading);
Then you just reference the ffc like you did with 'this':

ffcnamegoeshere->Vx = 1;.

An X velocity of '1' will make it more to the right at a rate of 1 pixel per frame.


How do you get ffcs to move when pressing the directional buttons?
Well, you do pretty much the same thing I just said, but you make it conditional to whether Link is pressing the button or not!

Just a simple little 'if' command.

if(Link->InputA){
//then do some velocity maniplation here
}

The 'Link->Input ?? ' command works as a boolean.

It's true if Link is pressing the button, false if he's not.

How do you make things happen when an ffc touches Link or another ffc?
I'll come back to this one when it's not 1AM, it's more complex.

How do you make Link invisible?
Make an item with LTM that will move Link's tiles down to somewhere on the tilesheet that they're all transparent.

How do you force enemies to target another ffc?
Eh?

How do you draw text on a screen?
Very simple:

Screen->Message(message number goes here);
You'd want:
Messages Freeze All Action
Messages Dissapear
Quest rules checked, and you might want to wait a couple of frames after it if you then want to continue with the script.


How do you draw a 2x2 frame on a screen?
Well, in a number of ways.
Either by putting a 2x2 FFC where you want the frame, or with Screen->Drawtile.
I'll come back to those too.


How do you highlight and change the color of existing text?
With the text editor.
Check the Wiki.

Mega Link
01-24-2008, 09:17 PM
Oooo, you're going to do it yourself?

Very good ^_^
Only because no one will make it or even reply to the thread.:mad:

How do you force enemies to target another ffc?
Eh?

What I meant was that, instead of shooting at Link, they'll shoot at the ffc that looks like Link while the real one is invisible.

How do you draw text on a screen?
Very simple:
Code:
Screen->Message(message number goes here);
You'd want:
Messages Freeze All Action
Messages Dissapear
Quest rules checked, and you might want to wait a couple of frames after it if you then want to continue with the script.
Not what I wanted. I want it to write text at a certain position, and the text is defined by script.

How do you highlight and change the color of existing text?
With the text editor.
Check the Wiki.
Again, I want it done entirely by script.

Russ
01-25-2008, 01:48 AM
Only because no one will make it or even reply to the thread.:mad:

What I meant was that, instead of shooting at Link, they'll shoot at the ffc that looks like Link while the real one is invisible.

Not what I wanted. I want it to write text at a certain position, and the text is defined by script.

Again, I want it done entirely by script.
For the enemies targetting a fake Link, I don't think it's possible. Sorry.

As for the text being written by script, I believe draw tile would work. Unfortunatly, I don't know how to use it, so you'll have to wait for Joe to help you on that one.

Joe123
01-25-2008, 04:01 AM
Only because no one will make it or even reply to the thread.
Well, I was going to reply to it, but only to say 'No, I don't want to use it in my quest', so I thought it probably wasn't worth getting your hopes up...

Anyway.

Yah, you'll have to script enemies for that one.

Or just hide Link underneath the boat.
Which is probably much simpler.


void DrawTile(int layer, int x, int y, int tile, int blockw, int blockh, int cset, float scale, int rx, int ry, int rangle, int flip, bool transparency, int opacity)

Draws a block of tiles on the specified layer of the current screen, starting at (x,y), using the specified cset. Starting with the specified tile, this method copies a block of size blockh x blockw from the tile sheet to the screen. This method's behavior is undefined unless 1 <= blockh, blockw <= 20. The scaling and rotation parameters are reserved for the future, and not currently implemented. This method's behavior is undefined unless rx=ry=rangle=0 and scale=1. Flip specifies how the tiles should be flipped when drawn: 0: No flip 1: Vertical flip 2: Horizontal flip 3: Both (180 degree rotation) If transparency is true, the tiles' transparent regions will be respected. Opacity controls how transparent the solid portions of the tiles will be. Values other than 128 (solid) and 64 (translucent) are currently undefined.

An example would be:

Screen->DrawTile(layer, Xcoord, Ycoord, Startingtile, Blockwidth, Blockheight, Cset, 1, 0, 0, 0, 0, true, 128);
Make sure to capitalise the 'T' in 'Tile', otherwise it won't compile.

How do you make things happen when an ffc touches Link or another ffc?
To do this, you have to check distances between things.
You draw a pseudo square (as in, you don't see it, but the script 'sees' it) around one of the objects, then check whether the other object is within that square.

The easiest way to do this is to use the 'Abs' function.

'Abs' (or 'absolute') takes a number, and returns only a positive value for it, so if the num ber is a negative number, it will turn it into a positive number.

So what you'd do is:
In an 'if' command, subtract Link's X coordinate from the ffc's X coordinate.
This returns a value of distance, but it isn't very useful at the moment, due to the fact that it might be below 0.
So you return the Abs value for it, then check if that is less than that distance you want to know between the two.
Then repeat, for the Y coordinate.

Like this:

if(Abs(Link->X - this->X) < 20) && Abs(Link->Y - this->Y < 20)){
//do whatever
)

Mega Link
01-25-2008, 08:19 PM
Ok.

Another question.

What is the proper way to give Link the compass for a specific Dmap?

Gleeok
01-25-2008, 10:29 PM
You could check it in initial data...or Link->Item[?]=true;



Again, I want it done entirely by script.

I don't think that is possible without some acrobatics. You could always use combos or DrawTile and set them up yourself in the tiles page.




How do you get ffcs to move?
this->Vx,this->X,thisAx: velocity, directly change, and accell.

How do you get ffcs to move when pressing the directional buttons?

if(Link->InputLeft){//do stuff

How do you make things happen when an ffc touches Link or another ffc? -again Abs works well.

How do you force enemies to target another ffc? You script custom enemies.

How do you draw a 2x2 frame on a screen? -DrawTile, or Large ffc's

Mega Link
01-25-2008, 11:02 PM
Don't you have to make a loop in order for this code to work?

if(Link->InputA){
//then do some velocity maniplation here
}