User Tag List

Page 2 of 9 FirstFirst 1 2 3 4 ... LastLast
Results 11 to 20 of 90

Thread: newww questions

  1. #11
    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.13%

    Re: newww questions

    so i shouldnt use waitframes becauseit halts ALL functions in the script even if its in a seperate level? like:

    Code:
    //blah blah variables and stuff
    {//more variables
    {waitframes(30)//tada!! magic variable...
    }//whatever function
    }
    where as i would see, it would halt only the things in that level of brackets, instead of the whole script altogether.

    ok these are the variables i need obviously but i also need to know how to set it to "bounce" off un-walkable combos and specific combos you set. which would be the D: things.i need to know how to set those up altogether actually...

    and so i have to have this in an if function, so that means

    Code:
    if(this->X == x && this->Y == y){whatever}
    the way im reading this it says that if the ffc is at these coordinates, then it does whatever is in the code in the brackets, right? and whats the difference between capital and lowercase X and Y variables?
    ... 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)

  2. #12
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.52%

    Re: newww questions

    this->X is a built-in variable; it always is equal to whatever the FFC's X coordinate is, and if you write to it, the FFC automatically moves there.
    x is a home-made variable Joe created. These ordinary variables don't do anything special when read or written to, but are used to temporarily store information. For instance,
    Code:
    ffc script foo
    {
      void run()
      {
        while(true)
        {
          int x = Link->X;
          int y = Link->Y;
          Waitframes(30);
          this->X = x;
          this->Y = y;
        }
      }
    }
    will cause the FFC to remember Link's X and Y position, wait 30 frames, then teleport to that position.

  3. #13
    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.13%

    Re: newww questions

    oooh ok this makes sense. so then basically that is what i was trying to make them do except that makes them teleport whereas i need them to have a specific speed to move to there. I understand... ok so,

    Code:
    ffc script foo
    {
      void run()
      {
        while(true)//this means while the ffc exists
        {
          int x = Link->X;  //this means to store links X coordinates in x
          int y = Link->Y;  //this is the same thing but using Y
          Waitframes(30);  //wait 30 frames
          this->X = x;  //ffc goes directly to the stored x
          this->Y = y;  //directly to the stored y
        }
      }
    }
    ok... i understand... so how would i plug velocity into this so it doesent look quite so jumpy in the quest? do you have to set the velocity for movement before you set any special actions involving movement? this wouldnt make sense... to do that you would have to set the velocity for regular movement, then for special movement, then plug in the variables for special movement in the "attack" function in the script...

    would you do this at the beginning and use homemade variables like joes to refrence them?
    ... 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. #14
    &&
    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,304
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.76%

    Re: newww questions

    I think I assumed you had a little more knowledge of this than you actually do, apologies if I did (/you do and I'm now being patronising).

    Let's start with the discretion between variables and functions.
    Variables are numbers that you can manipulate, and they come in 3 tasty methods:
    • Integers (declared with 'int')
    • Booleans (declared with 'bool')
    • Floats (declared with 'float')


    Booleans can only have two values, '0' and '1'.
    In script, they are given 'true' and 'false', and are great for switches and the like.
    Integers and Floats are a little misleading.
    ZScript makes no discretion between int and float, all integers and all floats are numbers with up to 4 decimal places (so there are no real integers).

    You declare vairables like this:
    Code:
    bool fooieo;
    bool foo = true;
    int bar;
    int barieo = 15;
    I've never used floats personally.

    And to use a variable you must first declare it, or the script will not compile properly.

    The first line declares the boolean 'fooeio', and sets it to 'false'
    The second line declares the boolean 'foo', and sets it to 'true'
    The third line declares the integer 'bar', and sets it to '0'
    The fourth line declares the integer 'barieo', and sets it to '15'.


    You can then access your variables at other points during the script just by putting in their names.
    Don't put the declaration word before them again, because you can't declare two variables with the same name in the same scope.


    Functions are what you'll find in ZScript.txt, and are all (well, most of them are) accessed with pointers.
    Let's take the function 'GetCurDmapScreen()'.
    This function returns the value of Link's screen in the current DMap.

    Referring to ZScript.txt, it is in the 'Game' section, so to access it, we use the 'Game->' pointer.
    Like so:
    Code:
    Game->GetCurDmapScreen()
    So, this function returns an integer, but at the moment we aren't doing anything with it, so let's combine it with an integer we declared earlier, and an if command:
    Code:
    int foo;
    foo = Game->GetCurDmapScreen();
    
    if(foo == 10){//do something nice}
    So we declared the integer foo, then we set it to the current Dmap Screen.
    Notice that this line ends in a semi colon, as is the way with functions.

    Then we checked whether foo was equal to 10, then if it was, we did something nice. (well, don't just put notes and then write out what you want the script to do, it won't work very well =P).


    http://www.purezc.com/forums/index.php?showtopic=25946
    This thread is great for understanding integers.

    I haven't covered everything you asked, but it's quite important that you understand that much.
    I'll go over the other bits, and post a bit of example script of how to do what you're asking after you get this much.

    EDIT: Don't you just hate it when two people've posted by the time you've finished writing what you're saying =P

  5. #15
    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.13%

    Re: newww questions

    ok... yea i think i kno a little less than i thought too...

    but i understand that:

    1-variables can describe things in 2 ways.
    a-true/false
    b-as a number value, like a Dmap # or if you have a certain piece of triforce.
    also, that in Zscript, it wont tell the difference between int and float, so they are basically the same thing.[maybe?]
    and another also, you can set variables and refrence them any time in the script, but inly using the variable name without the bool or int tags. like saying int foo in the beginning and just saying plain foo in later parts.

    2 functions are arrangements of variables to preform specific actions. pretty simple...almost...

    which means i also have questions lol

    so if you set some variable like foo in the beginning, and refrence it later, it will be whatever you made it when you refrence it. meaning if you refrence after you made foo's value = 10, then basically youre refrencing the value. but what about the next time you refrence it? will it still be the same amount or will it reset?

    and why did you add "ieo" to foo and bar? was that just another name for a homemade variable or does it have something to do with the variables themselves?
    ... 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. #16
    &&
    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,304
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.76%

    Re: newww questions

    Yes, that's better :)

    Functions can be other things aswell as arrangements of variables too though.
    Code:
    Game->PlaySound(message);
    Obviously uses a vairable, but it is input only (you couldn't it in an if requirement), playing the sfx that the integer 'message' is set to.

    The ieo was just to make them into different names; you can't declare two variables with the same name in the same scope.
    There are some other names for dummy variables, but they didn't come to mind at the time.

    I'll write up a bit of example code for how I'd do what you're asking in a bit.

  7. #17
    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.13%

    Re: newww questions

    ok thanks XD i understand slightly better now, even though i know theres more to get, i think it would be easier to write a script knowing these things lol

    but now i have new questions. 2 of them. lol and one is slightly off-topic. [only slightly]

    so ill start with that one. its just out of curiosity.

    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.

    and the other,

    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?
    ... 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. #18
    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.1%

    Re: newww questions

    ...

    ha

    HA!

    HA HA!
    This is it! This is what I need for my Doppelganger Replicator. Yes!

    *goes off to code*

    EDIT: Question from me now. I need a way to make an FFC invisible and visible.

  9. #19
    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.13%

    Re: newww questions

    is amaster ok? it seems he just had a brain fart... [my word for insanely obvious idea]
    ... 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. #20
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.52%

    Re: newww questions

    Quote Originally Posted by Master Maniac View Post
    ok thanks XD i understand slightly better now, even though i know theres more to get, i think it would be easier to write a script knowing these things lol

    but now i have new questions. 2 of them. lol and one is slightly off-topic. [only slightly]

    so ill start with that one. its just out of curiosity.

    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 so, but I'm not sure; try it
    and the other,

    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?
    Setting an FFC's data to 0 or moving it far off screen (-100,-100 should do nicely) both kill FFCs.

    EDIT: Question from me now. I need a way yo make an FFC invisible and visible.
    Set its datato a non-0 combo with a fully transparent tile.

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