User Tag List

Page 3 of 9 FirstFirst 1 2 3 4 5 ... LastLast
Results 21 to 30 of 90

Thread: newww questions

  1. #21
    Wizrobe The_Amaster's Avatar
    Join Date
    Dec 2005
    Location
    St. Mystere
    Age
    32
    Posts
    3,803
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,810
    Level
    28
    vBActivity - Bars
    Lv. Percent
    26.09%

    Re: newww questions

    Kinda yeah. For some weird reason, it hadn't occured to me to use
    Code:
    this->X = x;

  2. #22
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Re: newww questions

    but now i have new questions. 2 of them. lol and one is slightly off-topic. [only slightly]
    It's your topic =P

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

    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?
    Yeah, if you set an ffc's data to '0', it dissapears and any scripts it is running stop.


    Question from me now. I need a way to make an FFC invisible and visible.
    There is a flag called 'Only visible to lens of truth' in the ffc.
    You can access that with:
    Code:
    this->Flags[thatflag] = true;
    Although I can't remember what number flag it was; check std.zh for that.
    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.

  3. #23
    Gibdo Master Maniac's Avatar
    Join Date
    Aug 2007
    Location
    umm in a house
    Age
    32
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,533
    Level
    16
    vBActivity - Bars
    Lv. Percent
    47.1%

    Re: newww questions

    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)

  4. #24
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Re: newww questions

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

    How it works is:
    Code:
    while(Abs(this->X - x) > 4) || Abs(this->Y-y) > 4){
    It checks if either the ffc's X coordinate is within 4 pixels of the stored x, or the same for the Y.
    Code:
    Abs(this->X - x) > 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:
    ||
    Or
    Code:
    Abs(this->Y-y) > 4)
    Then does the same for the y coordinates.

    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.

  5. #25
    Gibdo Master Maniac's Avatar
    Join Date
    Aug 2007
    Location
    umm in a house
    Age
    32
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,533
    Level
    16
    vBActivity - Bars
    Lv. Percent
    47.1%

    Re: newww questions

    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,

    Code:
    while(Abs(this->X - x) > 4) || Abs(this->Y-y) > 4){(this->X=x)&&(this->Y=y)
    }
    right? or would that disregard the velocity and distance variables and just teleport it to there instantly?
    ... 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)

  6. #26
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Re: newww questions

    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.

  7. #27
    Gibdo Master Maniac's Avatar
    Join Date
    Aug 2007
    Location
    umm in a house
    Age
    32
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,533
    Level
    16
    vBActivity - Bars
    Lv. Percent
    47.1%

    Re: newww questions

    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)

  8. #28
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Re: newww questions

    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!
    Precisely.

    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.
    No, it stops for half a second, then repeats again.
    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.

    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?
    Yes, that's not hard, but there is still no 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.
    Well the point is that the script then tracks a new coordinate...

    or i could make it track to another ffc's coordinates and move to there and then return to the normal movement.
    //Integer 'foo' is set to D1, just as an example of the syntax.
    I said.
    It's there to show you that to access D1-D8, you put a comma between each integer declaration.

  9. #29
    Gibdo Master Maniac's Avatar
    Join Date
    Aug 2007
    Location
    umm in a house
    Age
    32
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,533
    Level
    16
    vBActivity - Bars
    Lv. Percent
    47.1%

    Re: newww questions

    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)

  10. #30
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,303
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.74%

    Re: newww questions

    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:

    Code:
    while(Abs(this->X - x) > 4) || Abs(this->Y-y) > 4){(this->X=x)&&(this->Y=y)
    }
    This is very bad.
    Code:
    while(Abs(this->X - x) > 4) || Abs(this->Y-y) > 4){
    	this->X = x;
    	this->Y = y;
    	Waitframe();
    }
    What it should be (well, not in that specific script, but for the correct syntax) is this.

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social