Graal Forums

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

killerogue 08-04-2006 08:40 AM

Tree Chopping?
 
PHP Code:

// Made by Kaidenn

// This is an example. Please rescript

function onCreated() {
  
setshape(14848);
  
this.life 5;
  
this.maxlife 5;
  
setcharani(NULLNULL /* whatever you use*/);
}

function 
onActionAxeHit() {
  if (
this.life 0) {
    
this.life--;
    
// set your gani in some weird step script
  
} else {
    
setTimer(10);
  }
}

function 
onTimeout() {
  
onCreated();
}

//#CLIENTSIDE

function onCreated() {
  
setshape(13232);


Ok FIRST AND FOREMOST. I DID NOT START THIS SCRIPT. I WOULD JUST LIKE TO KNOW HOW TO COMPLETE IT. IT WAS MADE FOR MY SERVER. It's supposed to go like this showimg in between axe swings then after a certain number it's supposed to play a gani of the tree falling. Where and what do I write to make this so in this script? Help please?

KuJi 08-04-2006 08:42 AM

Quote:

Originally Posted by killerogue
PHP Code:

// Made by Kaidenn

// This is an example. Please rescript

function onCreated() {
  
setshape(14848);
  
this.life 5;
  
this.maxlife 5;
  
setcharani(NULLNULL /* whatever you use*/);
}

function 
onActionAxeHit() {
  if (
this.life 0) {
    
this.life--;
    
// set your gani in some weird step script
  
} else {
    
setTimer(10);
  }
}

function 
onTimeout() {
  
onCreated();
}

//#CLIENTSIDE

function onCreated() {
  
setshape(13232);


Ok FIRST AND FOREMOST. I DID NOT START THIS SCRIPT. I WOULD JUST LIKE TO KNOW HOW TO COMPLETE IT. IT WAS MADE FOR MY SERVER. It's supposed to go like this showimg in between axe swings then after a certain number it's supposed to play a gani of the tree falling. Where and what do I write to make this so in this script? Help please?

Follow the comments x.x

killerogue 08-04-2006 09:00 AM

Er, the second comment. Set your gani in some weird step script? I don't know how to script at all. Therefore help. O_O

KuJi 08-04-2006 10:50 AM

setani("sh_woodtree", 20 + this.life);

Do something like that and have in the gani starting from 25 to 20 being good to damaged

Admins 08-15-2006 01:12 AM

In the gani you will need to add the different tree graphics so that you see them on the left side (for Kujis example use sprite numbers 20 to 25), make the gani single-direction, and add a sprite in the middle. Use PARAM1 for the sprite index, and modify the default param 1 to a value to 20 so that you actually see the sprite.

Alternatively you could also do many different tree ganis, and at the second comment you see the animation depending on this.life, like
if (this.life==5) this.ani = "mytree5"; else this.ani = "mytree4";

KuJi 08-15-2006 01:14 AM

Quote:

Originally Posted by Stefan
In the gani you will need to add the different tree graphics so that you see them on the left side (for Kujis example use sprite numbers 20 to 25), make the gani single-direction, and add a sprite in the middle. Use PARAM1 for the sprite index, and modify the default param 1 to a value to 20 so that you actually see the sprite.

I finished it for them already, they just need to fix the gani on the tree because each chop moves it around - pure genious @ drogan :P


All times are GMT +2. The time now is 10:47 PM.

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