Kinda yeah. For some weird reason, it hadn't occured to me to use
Code:this->X = x;
Kinda yeah. For some weird reason, it hadn't occured to me to use
Code:this->X = x;
It's your topic =Pbut now i have new questions. 2 of them. lol and one is slightly off-topic. [only slightly]
I don't think that would work, _L_ said that centre statue combos work by spawning fireshooter enemies when the screen is loaded, so in that case it wouldn't work.if you have an ffc and the combo its set to is a center statue combo, and the screen flag statues shoot fire is on, will it give the ffc the effect of shooting fireballs? it seems to make sense, but it might not work since it makes it a different kind of combo.
What you'd do for that is take C-'s or Gleeok's enemy ghost scripts, then attach a fireshooter enemy to the ffc with them.
I've done it many a time and it works nicely.
Yeah, if you set an ffc's data to '0', it dissapears and any scripts it is running stop.ive seen other game making programs where you have to set up EVERYTHING. HP movement buttons actions items enemies EVERYTHING. one of the commands in that is to destroy an object. as in to give the effect of killing a boss, it makes the object disappear. is this possible to do with ffcs? after you kill the ghosted enemy, you could link the existence of the FFC to the health of the enemy, but that seems more complex. is there just a command to "destroy" an ffc after a certain objective in the script is reached?
There is a flag called 'Only visible to lens of truth' in the ffc.Question from me now. I need a way to make an FFC invisible and visible.
You can access that with:
Although I can't remember what number flag it was; check std.zh for that.Code:this->Flags[thatflag] = true;
Obviously that'll only work if you're not using the lens, but who really does?
I've written that example script now MM, just noting up.
ah ok it makes sense. ill just make the enemies attached to the ffc's be shooters then.
and then when they die, they will set the data to 0. easy enough to understand.
thanks for all your help btw lol
... i just died a little inside...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"
--Andross Maximillion Remedy
(otherwise known as Rem)
What the second while loop does is to keep the script waiting until the ffc reaches (near to) the stored coordinates, before letting the script loop round, and the ffc go again.Code:ffc script movetolink{ // start the ffc script void run(int time, int foo){ // Start the void run command, which all script must begin with. // Also, at this point, the integer 'time' is declared. // This integer is set via 'D0' of the ffc in ZQuest. // Integer 'foo' is set to D1, just as an example of the syntax. int x; int y; // Declare the coordinate storage variables int xd; int yd; // Declare the distance storage variables int xs; int ys; // Declare the speed storage variables // You could write the script without storing the speed or distance variables, but I'm just // using them to tidy it up a bit, and make it more explanitory what I'm doing really. if(time == 0) time = 10; // A little 'defaulting' if. // Just means that if you leave 'time' to be 0 in D0, it'll be set to 10. // Division by 0 is not allowed. while(true){ // The 'while' loop. // It'll keep looping 'while' the conditions within the parenthesis are true. // 'While(true)' will loop forever. x = Link->X; // Set the coordinate storage variables to Link's position y = Link->Y; Waitframes(30); // Seeing as this script only deals with this one function, we're going to wait // for 30 frames within it, usually I wouldn't do that. xd = Abs(this->X - x); // Set the absolute value of the distance between the ffc's current position yd = Abs(this->Y - y); // and the stored coordinates into the distance variables. xs = xd/time; // Set the speed variables to be the distance divided by the time ys = yd/time; // This isn't necessary, but it's more explanitory. this->Vx = xs; // Set the vertical and horizontal components of the ffc's velocity to their this->Vy = ys; // repective speeds. while(Abs(this->X - x) > 4) || Abs(this->Y-y) > 4){ // Another while loop, this time much more complex. // I'll explain this outside the code box. Waitframe(); } // End this while loop this->Vx = 0; // Stop the ffc from moving once it gets there. this->Vy = 0; // It'll now wait and repeat the process after 30 (well, 31) frames. Waitframe(); // Wait for a frame, then re-loop the while(true) loop } } // End the void run } //End the script
How it works is:
It checks if either the ffc's X coordinate is within 4 pixels of the stored x, or the same for the Y.Code:while(Abs(this->X - x) > 4) || Abs(this->Y-y) > 4){
Returns the absolute paramater of the distance between the ffc and the stored coordinate, and if it's greater than 4, lets the loop continue.Code:Abs(this->X - x) > 4
OrCode:||
Then does the same for the y coordinates.Code:Abs(this->Y-y) > 4)
If either of them are not within four pixels of the stored coordinates, the while loop will continue looping 'Waitframe();'.
This means that the rest of the script will not continue.
Note that while loops with no waitframe in them are usually bad, because they stop the system from running.
Especially if they are while(true) loops.
EDIT: That's ok, I have little better to do apparently.
lol strangely this makes sense to me. so if i want it to "attack" after it reaches a certain coordinate i would use something like,
right? or would that disregard the velocity and distance variables and just teleport it to there instantly?Code:while(Abs(this->X - x) > 4) || Abs(this->Y-y) > 4){(this->X=x)&&(this->Y=y) }
... i just died a little inside...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"
--Andross Maximillion Remedy
(otherwise known as Rem)
I've made a slight update to the script, because I missed a bit out.
Have another look, I think you're confused.
What the script does is:
Set the ffc's Vx and Vy so that it should move to that point, idles while it moves (this is what the while loop does), then stops when it gets there and repeats (the bit I added was it stopping).
The idea was that 'It attacking' was the movement to the point where Link was standing.
And I'm going to have a big spiel about conditions and functions syntax in a minute, but we'll wait till you understand how it works first.
oh...OH! i get it. this is the part itself where it moves to the stored link position. which means, that the Vx and Vy that you set in the beginning IS the velocity for when the ffc moves to the link position.hah!
ok now that i get that, the ending part. it looks like it makes the ffc stop for a half secondand then return to normal movement. so after this bit, i could, instead of making it stop, i could make it move to a specific coordinate and then continue normal movement?... no... no id have to repeat the process, except make it return to a specific coordinate instead of a tracked one and then repeat it.[BRAIN FART!!]
or i could make it track to another ffc's coordinates and move to there and then return to the normal movement.
anyway back to the script, it also looks like foo isnt used. why did you define it if it serves no purpose? unless its to be refrenced later?
... i just died a little inside...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"
--Andross Maximillion Remedy
(otherwise known as Rem)
Precisely.oh...OH! i get it. this is the part itself where it moves to the stored link position. which means, that the Vx and Vy that you set in the beginning IS the velocity for when the ffc moves to the link position.hah!
No, it stops for half a second, then repeats again.ok now that i get that, the ending part. it looks like it makes the ffc stop for a half secondand then return to normal movement.
And again.
And again.
Forever.
There is no 'Normal Movement'.
There is 'this movement', which is:
ffc stops for 30 frames.
ffc moves to point where Link was 30 frames ago.
repeat.
Yes, that's not hard, but there is still no normal movement.so after this bit, i could, instead of making it stop, i could make it move to a specific coordinate and then continue normal movement?
Well the point is that the script then tracks a new coordinate...... no... no id have to repeat the process, except make it return to a specific coordinate instead of a tracked one and then repeat it.
or i could make it track to another ffc's coordinates and move to there and then return to the normal movement.I said.//Integer 'foo' is set to D1, just as an example of the syntax.
It's there to show you that to access D1-D8, you put a comma between each integer declaration.
oh ok so basically, this script makes it "attack" over and over until it dies. i get it.
and since there is no "normal movement" theres nothing to return to. i would have to define that myself.so is it possible to make it do this periodically, and between attacks have some sort of movement pattern?... never mind that... i could probably figure that out myself. anythings possible with scripting almost lol
and also when setting the Vx and Vy variables, are they set in pixels per frame?
... i just died a little inside...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"
--Andross Maximillion Remedy
(otherwise known as Rem)
Yes, having it periodically move between patterns isn't too hard.
This is exactly what I did with my first script boss actually, what a coincidence.
However, you won't be able to use the script as it is to do that.
Find another movement pattern, and I'll give you a hand to patch them together.
And yes, I think they are.
Right, syntax lecture:
This is very bad.Code:while(Abs(this->X - x) > 4) || Abs(this->Y-y) > 4){(this->X=x)&&(this->Y=y) }
What it should be (well, not in that specific script, but for the correct syntax) is this.Code:while(Abs(this->X - x) > 4) || Abs(this->Y-y) > 4){ this->X = x; this->Y = y; Waitframe(); }
Syntax/commands for within requirements:
- && - And
- || - Or
- ! - Not
- == - Equal to
- != - Not Equal to
- < - Less than
- <= - Less than or equal to
- > - More than
- >= - More than or equal to
- () - Used for grouping functions together
Syntax/commands for normal function lines:
- = - Is set to
- ; - Ends a function line. Always, with no shadow of a doubt
Don't try to use them interchangeably, '(this->X=x)&&(this->Y=y)' is not some kind of a function, you're trying to make requirements into functions.
There are currently 1 users browsing this thread. (0 members and 1 guests)