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 03-20-2011, 11:21 PM
skillmaster19 skillmaster19 is offline
Registered User
Join Date: Oct 2010
Posts: 392
skillmaster19 will become famous soon enough
NPC combat

I have created a NPC that you can kill by slashing it three times, and respawns in a different spot after 5 seconds of dieing(also shows the dead gani.)

However, I am stuck with making the NPC actually fight and kill the player. where are the scripts documented that I would best use to make the NPC follow the player/ walk around, swing its sword, shoot a projectile such as an explosive, etc?
Reply With Quote
  #2  
Old 03-20-2011, 11:36 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
I would recommend taking a look at Gambet's gBaddy 3.0

Source:
http://forums.graalonline.com/forums...hp?t=134258428
__________________
Quote:
Reply With Quote
  #3  
Old 03-20-2011, 11:48 PM
skillmaster19 skillmaster19 is offline
Registered User
Join Date: Oct 2010
Posts: 392
skillmaster19 will become famous soon enough
Quote:
Originally Posted by fowlplay4 View Post
I would recommend taking a look at Gambet's gBaddy 3.0

Source:
http://forums.graalonline.com/forums...hp?t=134258428
That is nice, but it seems a little too complicated for me at the time (im new to gscript2)

is there any basic ways to make a simple baddy?
Reply With Quote
  #4  
Old 03-20-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
no
__________________
Reply With Quote
  #5  
Old 03-21-2011, 12:11 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by skillmaster19 View Post
That is nice, but it seems a little too complicated for me at the time (im new to gscript2)

is there any basic ways to make a simple baddy?
Well it's about breaking it down into pieces...

PHP Code:
function onCreated() {
  
setTimer(0.1);
}

function 
onTimeout() {
  
setTimer(1);
  
baddyLogic();
}

function 
baddyLogic() {
  if (
hasTarget()) {
    if (
targetInAttackRange()) {
      
attackTarget();
    } else {
      if (
targetInChaseRange()) {
        
chaseTarget();
      } else {
        
returnHome();
      }
    }
  } else {
    
findTarget();
  }

__________________
Quote:
Reply With Quote
  #6  
Old 03-22-2011, 11:33 PM
skillmaster19 skillmaster19 is offline
Registered User
Join Date: Oct 2010
Posts: 392
skillmaster19 will become famous soon enough
Got the baddy to work (and yes I did most of it myself)

Now I am attempting to make baddies that shoot arrows and cause explosions. I noticed there are functions for this in gs1, but are there some in GS2? if so, what are they?
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 01:46 AM.


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