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 07-27-2008, 08:24 PM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Custom baddies

I'm working on a system for custom baddies for my server. I already have the movement, targeting and attack systems done, so the more involved steps of creating a custom baddy are already done.

What should be the more simple step of creating a custom baddy is something I've never done before. Right now the custom baddies that I'm fighting are all block.png's, which doesn't make for a very interesting baddy. So can anyone tell me the technique for setting the animations on baddies?

My first thought was to simply create the baddy and that I'd be able to use replaceani, or setani on it, but since it isn't a showcharacter I'm not sure if that's possible.

Thanks!
Reply With Quote
  #2  
Old 07-27-2008, 08:26 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
setcharani
Reply With Quote
  #3  
Old 07-27-2008, 08:43 PM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Quote:
Originally Posted by Loriel View Post
setcharani
This isn't a very ellaborative answer, I know there is such a command but I wouldn't have posted this forum topic if I didn't need help that required an answer beyond what the Graal wiki can provide.

When you use this command is it necessary to check the direction of the baddy? And since the baddy is not a showcharacter how can you check which direction the baddy is facing in the first place?

Or would actually making it a showcharacter and then using setcharani on it work well enough?
Reply With Quote
  #4  
Old 07-27-2008, 08:59 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
If you are cool with the baddy being basically 32x32, showcharacter seems to be the way to go.

If not, you could emulate the whole thing with a bunch of clientside showanis and manually keeping track of the direction, I guess.
Reply With Quote
  #5  
Old 07-27-2008, 09:07 PM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Well, it doesn't need to be anything complicated, so I suppose showcharacter will work for now.
Reply With Quote
  #6  
Old 07-27-2008, 09:08 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by The_Kez View Post
This isn't a very ellaborative answer, I know there is such a command but I wouldn't have posted this forum topic if I didn't need help that required an answer beyond what the Graal wiki can provide.

When you use this command is it necessary to check the direction of the baddy? And since the baddy is not a showcharacter how can you check which direction the baddy is facing in the first place?

Or would actually making it a showcharacter and then using setcharani on it work well enough?
PHP Code:
function onCreated()
{
  
this.ani "myidle";
  
onMovementFinished();
}
function 
onMovementFinished()
{
  if ( 
shouldMove() )
  {
    
// move again
    
this.ani "mywalk";
  }
  else
  {
    
this.ani "myidle";
    
scheduleevent1"MovementFinished"", "" );
  }

Something like that has always worked for me. showcharacter() isn't neccesary.
__________________
Reply With Quote
  #7  
Old 07-27-2008, 09:12 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by cbk1994 View Post
[PHP]
Something like that has always worked for me. showcharacter() isn't neccesary.
Do you not get funny blocking behaviour without showcharacter?
Reply With Quote
  #8  
Old 07-27-2008, 09:12 PM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Hmm. Something like that would be nice but that brings back the question of; if it's not a showcharacter then how do you decide which direction the baddy is facing so that the gani will work properly?
Reply With Quote
  #9  
Old 07-27-2008, 09:14 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Loriel View Post
Do you not get funny blocking behaviour without showcharacter?
Nope :o
Quote:
Originally Posted by The_Kez View Post
Hmm. Something like that would be nice but that brings back the question of; if it's not a showcharacter then how do you decide which direction the baddy is facing so that the gani will work properly?
You don't have to use showCharacter() to change this.dir.
__________________
Reply With Quote
  #10  
Old 07-27-2008, 09:25 PM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Quote:
You don't have to use showCharacter() to change this.dir.
Okay so my custom movement system would have to calculate which direction to turn the baddy.
I now see why so many people would like to see a basic open-source baddy.
Reply With Quote
  #11  
Old 07-27-2008, 09:46 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by The_Kez View Post
Okay so my custom movement system would have to calculate which direction to turn the baddy.
I now see why so many people would like to see a basic open-source baddy.
getDir( targetx - this.x, targety - this.y );
__________________
Reply With Quote
  #12  
Old 07-27-2008, 09:53 PM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Quote:
Originally Posted by cbk1994 View Post
getDir( targetx - this.x, targety - this.y );
Awesome thanks
Reply With Quote
  #13  
Old 07-27-2008, 10:09 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Source code?
__________________
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:37 PM.


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