Results 1 to 2 of 2

Thread: Scripting Help.

  1. #1
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Smile Scripting Help.

    The problems is that it won't draw the colors as it should, well it doesn't draw them at all. There is probaly something simple that i just don't see.





    Simba Code:
    program ReflectionScript;
    {$DEFINE SMART}
    {$i srl\srl.scar}
    {$i reflection\reflection.simba}
    {$i srl/srl/misc/paintsmart.scar}

    const


    {---SMART Setup Constants---}
      WORLD = 32;
      MEMBERS = false;
      SIGNED = true;
    {---------------------------}

    var
      Playerss: TPlayerArray;
      Dots, TextDots: array of TPointArray;
      Colors: TIntegerArray;
      i, Level, x, y, z: Integer;
      TempPoint: TTile;
      Ratio: string;

    begin
      Smart_Members := MEMBERS;
      Smart_Server := WORLD;
      Smart_Signed := SIGNED;

      SetupSRL;
      SetupReflectionEx(true);

      SetArrayLength(Dots, 3);

      Colors:= [65280, 16776960, 255];

      repeat
        Dots[0]:= [];
        Dots[1]:= [];
        Dots[2]:= [];
        TextDots:= [];
        Playerss:= GetPlayers;
        Level:= GetMe.Level;
        for i:=0 to High(Players) do
          if (Playerss[i].Level < Level) then
          begin
            SetArrayLength(Dots[0], Length(Dots[0])+9);
            TempPoint:= TileToMM(Playerss[i].Tile);
            for z:=0 to 8 do
            begin
              x:= (z mod 3);
              y:= (z div 3);
              Dots[0][High(Dots[0])-z]:= Tile(TempPoint.x-1+x, TempPoint.y-1+y);
            end;
          end else
          if (Playerss[i].Level = Level) then
          begin
            SetArrayLength(Dots[1], Length(Dots[1])+9);
            TempPoint:= TileToMM(Playerss[i].Tile);
            for z:=0 to 8 do
            begin
              x:= (z mod 3);
              y:= (z div 3);
              Dots[1][High(Dots[1])-z]:= Tile(TempPoint.x-1+x, TempPoint.y-1+y);
            end;
          end else
          if (Playerss[i].Level > Level) then
          begin
            SetArrayLength(Dots[2], Length(Dots[2])+9);
            TempPoint:= TileToMM(Playerss[i].Tile);
            for z:=0 to 8 do
            begin
              x:= (z mod 3);
              y:= (z div 3);
              Dots[2][High(Dots[2])-z]:= Tile(TempPoint.x-1+x, TempPoint.y-1+y);
            end;
          end;
        x:= 0;
        for i:=0 to High(Players) do
          if TileOnMS(Playerss[i].Tile, 30) then
          begin
            SetArrayLength(TextDots, Length(TextDots)+1);
            TempPoint:= TileToMS(Playerss[i].Tile, 30);
            if (Playerss[i]. HPRatio = 0) then
              Ratio:= '100%'
            else
              Ratio:= IntToStr(Playerss[i].HPRatio)+'%';
            TextDots[x]:= TPAFromText(Ratio, 'SmallChars', z, y);
            for z:=0 to High(TextDots[x]) do
            begin
              IncEx(TextDots[x][z].x, TempPoint.x);
              IncEx(TextDots[x][z].y, TempPoint.y);
            end;
            Inc(x);
          end;
        SMART_DrawDotsEx(True, Dots[0], Colors[0]);
        SMART_DrawDotsEx(False, Dots[1], Colors[1]);
        SMART_DrawDotsEx(False, Dots[2], Colors[2]);
        for z:=0 to High(TextDots) do
          Smart_DrawDotsEx(False, TextDots[z], 16776960);
      until(false);

    end.


    ~Home

  2. #2
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    is debug enabled on the SMART client?

    Current Script Project
    Pot of flour gatherer - 95% done

    Can't get Simba to work? Click here for a tutorial

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
  •