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 10-11-2005, 03:55 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Scripting Baddies

I've been trying to make original baddy scripts for Classic, and I though that a good way would be to make ganis for them. However, I've been having loads of trouble.
1. setshape will not work on showcharacters.
a. small image sprites:
the frog baddy won't pick up a hit for me because it's too small of an image in the gani
b. large image sprites:
the tree baddy will only block a 32x32 square instead of the entire area it's on.

2. showani will not work serverside.

Anybody have some kindof advice for me? I would really appreciate it.
Reply With Quote
  #2  
Old 10-11-2005, 06:14 AM
ForgottenLegacy ForgottenLegacy is offline
-Backtoscripts-
Join Date: Aug 2003
Location: California
Posts: 289
ForgottenLegacy is on a distinguished road
Send a message via AIM to ForgottenLegacy
Quote:
Originally Posted by jake13jake
I've been trying to make original baddy scripts for Classic, and I though that a good way would be to make ganis for them. However, I've been having loads of trouble.
1. setshape will not work on showcharacters.
a. small image sprites:
the frog baddy won't pick up a hit for me because it's too small of an image in the gani
b. large image sprites:
the tree baddy will only block a 32x32 square instead of the entire area it's on.

2. showani will not work serverside.

Anybody have some kindof advice for me? I would really appreciate it.
A showcharacter NPC automatically creates a block of 32 by 32 pixels reserved by the NPC. The entire showcharacter NPC is 48 by 48 pixels, and the blocktiles are from (.5,1) to (2.5,3), which is a 32x32 pixel square. There is no *known* way to change this, so I'm thinking you would have to venture away from showcharacter and use setimg() and setimgpart() for this.

And you are right, showani() is a clientside function. It does not exist serverside.

The baddies I've seen are images with a setshape(), not showcharacter.
__________________
"The higher you fly, the harder it is to breathe."

[Kaidenn] Maybe I will somehow take control of Lance's body when he isn't looking, have him log onto Kingdoms, update one script, and leave.
[Kaidenn] And leave him exactly where I found him, unchanged and completely unnaware of what just took place the last two minutes.
[GrowlZ] Lance: You might want to lock your bedroom door tonight
Reply With Quote
  #3  
Old 10-11-2005, 07:55 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
the problem is that the animations are set by different actions that the baddy does. I mean, perhaps the tree baddy might be more functional clientside if I really think about it, but that would still leave the frog as a problem. It wouldn't be a major problem considering that the only real animated part is the grass shifting. I can do the frog jumping alright, not quite so good, with a few move algorithms. The only way to really do serverside to clientside translation is through a save var and that's very very inefficent, although it proves functional in my unfinished chess scripts (and I have bigger projects on my plate now, so I'm not going to finish it's self-check check any time soon). Would a for loop cycle with a sleep of .1 create lag problems on the NPC server? Also, would short time intervals on the movementFinished event handler cause lag problems?

Besides this, most of the baddies I'll be doing would be functional with showcharacter. I can probably limit myself to thinking 32x32 after all of these issues. Though, I just can't help but think how nice it would be if showani worked serverside. Just a few functions that are clientside-only that would make sense to have serverside.
Reply With Quote
  #4  
Old 10-13-2005, 10:23 PM
petro1212 petro1212 is offline
Angelus
petro1212's Avatar
Join Date: Mar 2003
Location: The Moon
Posts: 445
petro1212 is on a distinguished road
Send a message via AIM to petro1212 Send a message via MSN to petro1212
jake simply don't use showcharacter... you could go trough the trouble of scripting your own "gani" withouth using ganis.. Simply by using setimage or showimage multipletimes :O and than changing the image on each step... that would get rid of your shape problem ?? :O
__________________
Reply With Quote
  #5  
Old 10-13-2005, 10:54 PM
Fry Fry is offline
Registered User
Fry's Avatar
Join Date: Sep 2001
Location: Germany
Posts: 384
Fry has a spectacular aura about
Quote:
Originally Posted by petro1212
jake simply don't use showcharacter... you could go trough the trouble of scripting your own "gani" withouth using ganis.. Simply by using setimage or showimage multipletimes :O and than changing the image on each step... that would get rid of your shape problem ?? :O
What the hell?
__________________
Graal Statistics

Top 3 servers at the moment (players):


Reply With Quote
  #6  
Old 10-16-2005, 01:23 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by petro1212
jake simply don't use showcharacter... you could go trough the trouble of scripting your own "gani" withouth using ganis.. Simply by using setimage or showimage multipletimes :O and than changing the image on each step... that would get rid of your shape problem ?? :O
the trouble with that would be:
1. It would obviously need at least a .1 timeout. (can't do it serverside).
2. There is bad serverside to clientside lag for changing modes.

But hey, I could try.
Reply With Quote
  #7  
Old 10-16-2005, 01:32 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by petro1212
jake simply don't use showcharacter... you could go trough the trouble of scripting your own "gani" withouth using ganis.. Simply by using setimage or showimage multipletimes :O and than changing the image on each step... that would get rid of your shape problem ?? :O
Hey, don't post bad advice.
__________________
Skyld
Reply With Quote
  #8  
Old 10-16-2005, 06:53 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
hmm... do you think putnpc2ing the grass stuff and then just using the froggy image would work?
I think it just might!
Reply With Quote
  #9  
Old 10-16-2005, 09:53 PM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
no offense, I don't mean to be rude...but why don't you try before asking?
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #10  
Old 10-17-2005, 07:00 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Knuckles
no offense, I don't mean to be rude...but why don't you try before asking?
I was thinking out loud.
....
Not technically out loud...


--but with my fingers.

I'm like 99% certain it will work that way though.
Reply With Quote
  #11  
Old 10-17-2005, 09:23 PM
ChibiChibiLuc ChibiChibiLuc is offline
Cookie Monster. :3
Join Date: Jan 2005
Location: Nova Scotia, Canada
Posts: 111
ChibiChibiLuc is on a distinguished road
Send a message via AIM to ChibiChibiLuc Send a message via MSN to ChibiChibiLuc
Well, I'm pretty sure the following way would work and be more efficient:

Put the baddy's mode in a save[].
Use a clientside timeout to read the save.
Draw the baddy's sprites, based on the save.

save[0..9] holds values that can be set and read on both the serverside and clientside. You could set the baddy's mode to a save in the serverside, then have it draw the baddy on the clientside, based on the save's value.
Reply With Quote
  #12  
Old 10-17-2005, 09:55 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
no, not really efficient, it really takes a while for saves to save.
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:52 PM.


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