Results 1 to 10 of 10

Thread: Quick question

  1. #1
    Join Date
    Mar 2007
    Posts
    137
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Quick question

    for a miner, when you declare players you can also say which ore to mine, after you do that how do you recall to that ore so it knows what colors to use?

  2. #2
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    var
      Colors: TIntegerArray;

    begin
      case LowerCase(Players[CurrentPlayer].Strings[0]) of
        'copper': Colors := [5487834, 32634, 7343];
        'tin': Colors := [567437, 54672436, 52373632];
        'iron': Colors := [3675327, 7243735, 724745];
        'coal': Colors := [547243, 5472, 32633];
        'mith': Colors := [5473475, 24745, 74374];
        'addy': Colors := [5763246, 45737, 7247435];
        'rune': Colors := [4632346, 63246234, 6352634];
      end;
    end.

    Like that?

  3. #3
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    on wii but w/e.
    do:
    SCAR Code:
    case lowercase(players[currentplayer].strings[0])
    that loads the first string in declareplares. tn declare orecolor as tintegerarray -make sure function results as dat too sooo:
    SCAR Code:
    result := orecolor[1234, 457, 679];
    darn u ian..i had 2 type wif wii-mote

  4. #4
    Join Date
    Mar 2007
    Posts
    137
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    awesome thank you both very much.

  5. #5
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Mhmm. And sorry for not being clear with the Players[CurrentPlayer].Strings[0] thing, I'm at work so I don't have SCAR and I'm trying to hurry. Haha

    SCAR Code:
    procedure DeclarePlayers;
    begin
       HowManyPlayers := 1; //How many Players
       NumberOfPlayers(HowManyPlayers);
       CurrentPlayer :=0; //Starting Player

       Players[0].Name := '';
       Players[0].Pass := '';
       Players[0].Nick := '';
       Players[0].Active := True;
       Players[0].Strings[0] := '';//this stuff
    end;

    Sorry! Work. Talk to you later.

  6. #6
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    __on computer__
    By the way mcnollend, mine was a little off use the one like in ians first post.
    If your using my way then do it like:

    SCAR Code:
    Function LoadRockColors: TIntegerArray;
    begin
      case LowerCase(Players[CurrentPlayer].Strings[0]) of
       'iron': Result := [24325, 234234, 5435];
       ETC.

    That way you can just do....something like:

    SCAR Code:
    For i := 0 to 5(aka number of colors including 0) do
    begin
    if findcolor(x, y, LoadRockColors[i], MSX1, MSY1, MSX2, MSY2)then blah;

    Since when it results as the colors you can just write in LoadRockColors where it says color in parameters.

    Good Luck~~

    Edit : declare i as an int.
    Last edited by Smarter Child; 08-20-2009 at 07:44 AM.

  7. #7
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by Smarter Child View Post
    __on computer__
    By the way mcnollend, mine was a little off use the one like in ians first post.
    If your using my way then do it like:

    SCAR Code:
    Function LoadRockColors: TIntegerArray;
    begin
      case LowerCase(Players[CurrentPlayer].Strings[0]) of
       'iron': Result := [24325, 234234, 5435];
       ETC.

    That way you can just do....something like:

    SCAR Code:
    if findcolor(x, y, LoadRockColors, MSX1, MSY1, MSX2, MSY2)then blah;

    Since when it results as the colors you can just write in LoadRockColors where it says color in parameters.

    Good Luck~~
    dont you need
    SCAR Code:
    for i := 0 to high(LoadRockColors) do
    if findcolor(x, y, LoadRockColors[i], MSX1, MSY1, MSX2, MSY2)then blah;
    //other stuff here :p

    since LoadRockColors is a tintegerarray, and findcolor uses integers
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  8. #8
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yah, you can do that in a separate func..oh i see wat you mean. Yes you do need that, i forgot about that.

  9. #9
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Or use some srl object finding. Some of them(or all?) uses TIntegerArrays for colors.

  10. #10
    Join Date
    Mar 2007
    Posts
    137
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, so if i use the case lowercase(etc etc) to find the ore that the person chose, would i use a findcolortolerance(x, y, color, etc) to find the rock on the screen?

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
  •