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 11-14-2010, 06:17 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Question baddy killing

hey i got another question. how is the script that i can kill npcs on playerworld? i have tried everything and looked everywhere but it wont work. just the normal baddies (blue soldier,...) will work, but not the other npcs. i can hit them but it wont play the gani and they wont die.
Reply With Quote
  #2  
Old 11-15-2010, 03:37 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Basically you can create your own baddie by setting this.hp and use onActionWas.Hit() ( remove the period, forum censors) for when the player uses their sword or onActionExploded() for bombs and just take away some hp, then just kill it when this.hp is zero.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #3  
Old 11-16-2010, 06:53 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
ill try what you mean but could you put in an example?
Reply With Quote
  #4  
Old 11-17-2010, 01:26 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Not for copying and pasting, it's more to give you an idea of some of the things you'll need.
PHP Code:
function onCreated(){
  
//set vars
  
this.respawnpos = {this.xthis.y};
  
setTimer(0.05);
}
function 
onTimeout(){
  
doMovement();
  
setTimer(0.05);
}
function 
doMovement(){
  if (
this.hp 0){
    
//do checks to see if a player is in the baddies aggro radius
   //then
    //do movement
  
}
}
function 
onActionWa****(){
  if (! (
this.hp <= 0)){
    
this.hp -= 0.5;
  } else 
doDead();
}
function 
doDead(){
  
//set animation to dead and add exp if thats what you're doing
  
scheduleevent(2"Respawn"null);
}
function 
onRespawn(){
  
//set x and y to where you want it to respawn at each time
  
this.this.respawnpos[0];
  
this.this.respawnpos[1];
  
this.hp this.maxhp;

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 02:58 AM.


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