Results 1 to 14 of 14

Thread: + IntToStr(Players[i].integers[0])+ in progress report!

  1. #1
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default + IntToStr(Players[i].integers[0])+ in progress report!

    so I've looked around the forums A LOT for this and i can't seem to find an explanation/tutorial on it so ill ask.

    fawaki has this in his gobbiez script:

    SCAR Code:
    'K : '+ IntToStr(Players[i].integers[0])+' Goblins. '

    and the only other place he has it is here in his attacking procedure:

    SCAR Code:
    Procedure WaitGoblin;
    var Mark5:Integer;
    begin
      FFlag(0);
      MarkTime(Mark5);
      repeat
      fighting
      until not InFight;
      Goblins := Goblins + 1;
      ReportVars[0] := ReportVars[0] + 1;
      Players[CurrentPlayer].integers[0] := Players[CurrentPlayer].integers[0]+1;
    end;

    and he uses it to keep track of the kills each player gets, I have tried to add this to my progress report and every time i put the
    SCAR Code:
    Players[CurrentPlayer].integers[0] := Players[CurrentPlayer].integers[0]+1;
    part in my script i get a
    SCAR Code:
    [Runtime Error] : Out Of Range
    so it would be great if someone could explain to me on how to get this to work it would be VERY VERY appreciated


    P.S. : i like the spell check on the replying/posting its very creative

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  2. #2
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Did you declare the players

    Join the fastest growing merchanting clan on the the net!

  3. #3
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    EDIT : Yeah nvm.

    It's because you haven't set up your players

    but fyi you don't have to do it this way you can use any variable you want

    Example:

    SCAR Code:
    var
     Killed : Integer

    begin
      repeat
        KillIt;    //Not real function just made it up
      until ISaySo
      Killed := Killed + 1;         //you can make this whatever you want just do +1 after each kill  
      WriteLn('You''ve killed ' +IntToStr(Killed)+ ' Goblins!');  //put this in your progress report
    end.

  4. #4
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    yes ive declared them...you guys obviously dont understand...sry to say but he doesnt have it declared in his array at all...like i said those are the only places it comes up in his script take a look and i dont want it to be killed like that cuz then it doesnt do each player seperately like i want

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  5. #5
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Pm me that section of the script (or msn found in sig). I will figure it out

    Join the fastest growing merchanting clan on the the net!

  6. #6
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Using SRL 4?
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  7. #7
    Join Date
    Aug 2007
    Posts
    282
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by SantaClause View Post
    Using SRL 4?
    if he wasnt wouldnt he get an unknown identifier?

  8. #8
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I still don't see why you can't just use a different variable?

  9. #9
    Join Date
    Aug 2007
    Posts
    282
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you could.. but this keeps it seperate for each player

  10. #10
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    You could still make an array..

    SCAR Code:
    var
      Killed : array of Integer;

    begin
      Killed[CurrentPlayer]:= Killed[CurrentPlayer]+1
      WriteLn('Killed ' +IntToStr(Killed[CurrentPlayer])+ ' Goblins')
    end.

    ? Save you a lot of time rater than figuring this out

  11. #11
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    // here gos: number of players
    // and: start player:


    for index := 0 to getarraylength(players)-1 do
    begin
    SetArrayLength(Players[Index].Strings, 1); // how many string i use is 1
    SetArrayLength(Players[Index].integers, 3); // how many integers i use is 3
    end;


    // here gos your player setup:
    // Players[0].active := True;



    EDIT: INDEX is a variable! so put this in:
    Index : integer;

    EDIT: it gos the same with boolean duh.
    SetArrayLength(Players[Index].booleans, {number of booleans useing});

    EDIT: remember:
    Players[?].strings[1] = Players[?].strings[0]
    Players[?].strings[2] = Players[?].strings[1]
    Players[?].strings[3] = Players[?].strings[2]
    Start your strings/booleans/integers with 0

    <--------------------------------->

    i had the same problem to, did this, and it was working again. gl

  12. #12
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    thx master exactly what i was talking about, i totally forgot about even setting it as an array

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  13. #13
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    check my sig on how to write your DeclarePlayers Procedure properly, you are missing a few procedures which define the length of the arrays.
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  14. #14
    Join Date
    Jun 2007
    Location
    I'm not sure...
    Posts
    581
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh, starblaster, btw, in the srl player form, does it declare the size of the arrays inside it?
    ---------------------------------------------------------


    Pm me if you need any math functions made. Me = l0ving t3h mathz

    ---------------------------------------------------------

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with Progress Report
    By Richard in forum OSR Help
    Replies: 4
    Last Post: 01-04-2008, 06:48 PM
  2. Best progress report?
    By Dangerous Garden Tools in forum News and General
    Replies: 12
    Last Post: 10-05-2007, 04:14 AM
  3. progress report:(
    By macromacro123 in forum OSR Help
    Replies: 0
    Last Post: 08-25-2007, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •