Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-04-2006, 08:40 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
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?
Reply With Quote
  #2  
Old 08-04-2006, 08:42 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
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
Reply With Quote
  #3  
Old 08-04-2006, 09:00 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
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
Reply With Quote
  #4  
Old 08-04-2006, 10:50 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
setani("sh_woodtree", 20 + this.life);

Do something like that and have in the gani starting from 25 to 20 being good to damaged
Reply With Quote
  #5  
Old 08-15-2006, 01:12 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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";
Reply With Quote
  #6  
Old 08-15-2006, 01:14 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
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
Reply With Quote
Reply


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 09:56 PM.


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