Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-02-2011, 11:26 PM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
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.
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #2  
Old 03-02-2011, 11:59 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
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);
}
Attached Thumbnails
Click image for larger version

Name:	boxarea.png
Views:	165
Size:	7.3 KB
ID:	52499  
__________________
Reply With Quote
  #3  
Old 03-03-2011, 12:01 AM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
wow...
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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