Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   setshape? (https://forums.graalonline.com/forums/showthread.php?t=134262289)

Astram 03-02-2011 11:26 PM

setshape?
 
Can someone help me use setshape? I dont understand it! Im trying to make a thing for chance, so when you touch it. It sets a flag, but it wont work, the shape.

xAndrewx 03-02-2011 11:59 PM

1 Attachment(s)
Ah, on iEra I didn't use that system... I used a box which moved around.

Here is a numbers version [imagine the image to be 3x3 boxes- not 2,2]
HTML Code:

function onCreated() {
  setTimer(10);
}

function onTimeout() {
    //There are in total 9 boxes (3 top, 3 middle & 3 bottom [ROWS])
  temp.box_kick = int(random(0, 10));
 
  this.chat = "Kicking Box" SPC temp.box_kick;
  scheduleevent(5, "KickBox", temp.box_kick);
}

function onKickBox(box_kick) {
  temp.p_box = {
    5 + (temp.box_kick * 12),
    5 + (temp.box_kick * 12)
  };
    //Now the boxes in the level start from 5 pixels from the left & 5 from the top
    // the size of the box is 10 tiles either side (width & height) and 4 tiles for
    // the wall size
  for (temp.i: players) {
    if (temp.i.x in |temp.p_box[0], temp.p_box[0] + 12| && temp.i.y in |temp.p_box[1], temp.p_box[1] + 12|) {
      temp.i.chat = "I've been kicked!";
    }
  }

  if (players.size() <= 1) {
    temp.pl = players[0];
    if (temp.pl != null) {
      temp.pl.chat = "Winner";
    }
    //Reset event & kick player etc
  }

  //Do it again etc
  setTimer(10);
}


Astram 03-03-2011 12:01 AM

wow... :D


All times are GMT +2. The time now is 06:43 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.