Graal Forums

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

Rapidwolve24 01-22-2008 12:36 AM

Heart Moniter
 
I want to script a dynamic EKG (with showpoly) to show the status of a players help, but the thing is I don't know how to begin, is there some sort of algorithim I have to follow?

http://forums.graalonline.com/forums...ad.php?t=77980
^ If you don't know what an EKG is

cbk1994 01-22-2008 03:16 AM

Well if you just made it spike randomly (controlled random- every 2 or 3 seconds, etc) and the same for the amount of spike, you could make an array of points to plot. Doesn't seem to hard, but of course it probably would be.

coreys 01-22-2008 04:12 AM

On the server I used to own someone who worked for me scripted just what you're talking about.
Unfortunately I have no idea how to do that.

Tigairius 01-22-2008 08:45 AM

Lol, that animation in the other post reminded me of a flash EKG machine I made.
http://www.olwest.net/Tig/md5live.html

I imagine you could just define some points in an array if you need to and then use a for loop to display the polygons from point to point as defined by the array; cbkbud is on the right track. You could probably just as easily figure out an algorithm for it, but right now I just don't feel like figuring it out, sorry.

Chompy 01-22-2008 05:48 PM

basicly you could do something like:

PHP Code:

function onCreated() {
  
this.dsize 10;
  
this.data 0;
  
this.mode 1;
}
public function 
onAddData(temp.data) {
  if (
this.mode == 1) {
    
this.data.insert(0temp.data);
    if (
this.data.size() == this.dsize+1){
      
this.data.delete(this.dsize-1);
    }
  }else if (
this.mode == 2) {
    
this.data.add(temp.data);
    if (
this.data.size() == this.dsize+1) {
      
this.data.delete(0);
    }
  }
}
public function 
onGetData()
  return 
this.data;
public function 
onGetDataAtIndex(index)
  return 
this.data[index]; 

So, use onAddData() to feed the array, depending on the mode the way it's read (mode 1 = read from left to right (index 0 and up), mode 2 = read right to left (last index to index 0))

Could be made easier tho, but, an EKG with player's health.. Doesn't sound.. 'logical' with graal as combo :p


All times are GMT +2. The time now is 02:13 PM.

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