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 04-22-2002, 04:03 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Torch NPC -Help?-

I'm trying to make a simple Torch for a quest for a server, but when I fire the weapon it goes wierd.When you walk, it is and idle gani without the light effect, when its idle, its a walking gani with light.Plz help meh I INDENT FOR YOU)
NPC Code:

if (weaponfired) {
if (client.torch==0) {
client.torch=1;
timeout=.5;
}
else client.torch=0;
}
if (timeout) {
if (client.torch==1) {
if (strcontains(#m,idle)) {
setani torch_idle,torch2.png;
}
if (strcontains(#m,walk)) {
setani torch_walk,torch2.png;
}
}
timeout=0.05;
}

__________________
maximus_asinus
Reply With Quote
  #2  
Old 04-22-2002, 08:11 AM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
UNTESTED
try...
NPC Code:

if (weaponfired) {
if (client.torch==0) {
client.torch=1;
timeout=.5;
}
else client.torch=0;
}
if (timeout) {
if (client.torch==1) {
replaceani idle,torch_idle;
replaceani walk,torch_walk;
}
timeout=0.05;
}

__________________
Reply With Quote
  #3  
Old 04-22-2002, 09:05 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
I tried replaceani, it doesn't show the lamp/torch.
__________________
maximus_asinus
Reply With Quote
  #4  
Old 04-22-2002, 04:44 PM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Quote:
Originally posted by darkriders_p2p
I tried replaceani, it doesn't show the lamp/torch.
That's strange, since the actual torch on Graal2001 does use replaceani.
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #5  
Old 04-22-2002, 06:55 PM
SaijinGohan SaijinGohan is offline
Registered User
SaijinGohan's Avatar
Join Date: Jul 2001
Location: U.S.A - Ohio
Posts: 536
SaijinGohan is on a distinguished road
Send a message via AIM to SaijinGohan Send a message via MSN to SaijinGohan
what you are trying to do is no practial logical way since you would have to use #m, setani, and replaceani. with replaceani you can only replace a gani with a gani and you want to setani with a new graphics so my suggestion would be to make a new gani using the torch2.png and using this code.

NPC Code:

if (weaponfired) {
if (!client.on) {
set client.on;
replaceani idle,torch_idle2;
replaceani walk,torch_walk2;
}else{
unset client.on;
replaceani idle,idle;
replaceani walk,walk;
}
}

__________________

Job: A Legend

And you think that you have played Graal forever? Ha!
Reply With Quote
  #6  
Old 04-22-2002, 11:16 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Well you could also have a timeout and send params with a setani...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #7  
Old 04-23-2002, 02:28 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Ok, I'll use replaceani but someone post teh ganis here, because mine might be broken.
__________________
maximus_asinus
Reply With Quote
  #8  
Old 04-25-2002, 09:17 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Why not put a walking gani? so if the gani = walking one, setgani walking_torch.gani i don't deal w/ gani's and sprites too much, heh.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #9  
Old 04-26-2002, 08:43 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
god, just putting me down in one thread after another! LOLz, how is that a bad solution? That is the solution i came up with. remember, i'm @ school and it is like EARLY! i can't get axx to the forums @ home, it won't load up for some reason?? So i don't have axx to all of my stuff and i'm thinking on little caffeine!
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #10  
Old 04-26-2002, 08:57 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Heh, true dat. I see what you're saying. But u could increase the timeout for that part and have it change the timeout l8er or something? or stop the gani if the player stops.
Yeah, you'er giving me something to do in first period, this is great. Thanx m8!
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #11  
Old 04-26-2002, 09:08 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Ah, point taken. I bow to your superior skillz heh. Yeah, there should be a way to change the default Gani. I mean not just one time use, but more of a global thing. I heard about their being one for tiledef and such.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #12  
Old 04-26-2002, 09:12 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Then why would it not work then? If you can replace the default ani's then the default ones should not show?? Sorry, if you can't tell i don't use ganis often, heh.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #13  
Old 04-29-2002, 08:14 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
LOL, okiez then. Perhaps just put an NPC of a torch and have it attachplayertoobj ?? that would seem easier, but maybe not as good looking.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #14  
Old 04-30-2002, 08:13 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
If you need it done, that is a way. The NPC will be on the player, make it sized so it hangs on the right, it won't be the best, but if it ABSOLUTELY needs done, i don't see what the problem is there?
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #15  
Old 04-30-2002, 08:24 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Yeah, i do. I've used it b/4. It puts the npc basically on top of the player. put a torch image w/ a partially transparent effect on top of the player. Or set it for playerx, playery (circular image that lights the place, then has a lantern on the right side where the players hand is. Then showimg timeout=0.05, hide the image, then show it player x, player y again, it is constantly updating and the image will be there until if (this.use==1&&weaponfired) timeout=0 (or crazy numbers like imaginary ones!)
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #16  
Old 04-30-2002, 08:50 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Yeah? and, you put the light all around, so it is visible, and the lantern on the right side of the person so it is barely visible. I am telling you it would work just fine, not the best, but would work.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #17  
Old 04-30-2002, 11:09 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Kaimetsu


No, it attaches the player to the NPC. If the NPC moves, the player moves with it. If the player moves, the NPC stays stationary. It's for making things like boats, where the player moves with the boat that he's standing on.
Man this guy is relentless with his wrong ideas. Attachplayertoobj type,id; is used for boats, trains, etc. If you want to make your torch npc work well, all you need to do is make a gani that has a light effect in it, use gani-scripting like ghostlights.gani from Graal2002 Server, and change the light effects on the attributes, and then all you need to do is replacegani or is it replaceani? Well either way, you replace walk with your walking gani and idle with your idle gani (Just edit walk and idle so they contain your gani-scripting and rename) and then you can do it find.
Oh yeah, and if you are sure this would work (your attachplayertoobj; ) then why did you start this thread?
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #18  
Old 05-01-2002, 08:03 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
1) I did not start this thread.
2) If you use timeouts you achieve it. I've done it b/4. not the best thing to use but whatever. This is pointless to argue on
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #19  
Old 05-01-2002, 11:01 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by emortylone
1) I did not start this thread.
---Shifter
Oops, sorry, I thought you did. I was having a bad day took it out in the wrong place, sorry man.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #20  
Old 05-02-2002, 08:26 PM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
That is okay. Some people like (me) are a bit thick, and like to think that they know more than smarter people (you). LOL, this is emortylone, on my real account now! Feels good, heh. I know what you guys are saying, but w/ a timeout=0.05 and then attach player toobj it would constantly put the NPC on top of the player. Oh well, dropping it, heh.
---Shifter
Reply With Quote
  #21  
Old 05-02-2002, 11:36 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Kaimetsu


Nargh it would put the player on top of the NPC!!!
Exactly if the npc would be on top of the player, it would be attachobjtoplayer not attachplayertoobj...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #22  
Old 05-03-2002, 08:40 PM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Lol, i know this. That is why i said it wouldn't be the best. The player would be under the light and lamp.
---Shifter
Reply With Quote
  #23  
Old 05-04-2002, 02:30 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Kaimetsu


And the player wouldn't be able to move properly.
Well let him try to script it and post it maybe?
If you attachplayertoobj; it takes the npc's setshape2; if that npc has none, it takes no set, so the player is stuck unable to move. Just use replacegani; unless SOMEHOW project shifter makes this...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
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:33 PM.


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