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 02-12-2002, 05:36 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Hat NPC -WHY?

This is my script.Plz tell meh whats wrong and maybe how to fix it.I think its the disabledefmovement OR triggeraction.
// NPC made by SeeD Captain /\/\ãxïmus Ðärkrïdër
if (playertouchsme) {
toweapons Hat NPC;
i=0;
}
if (weaponfired) {
set browsing;
disabledefmovement;
triggeraction playerx,playery,browsing,;
}
if (actionbrowsing) {
i=0;
showimg 200,hat#v(i).png,playerx,playery-2.5;
changeimgpart 200,96,0,55,55;
}
if (keydown(1)&&browsing) {
i++;
showimg 200,hat#v(i).png,playerx,playery-2.5;
changeimgpart 200,96,0,55,55;
}
if (keydown(3)&&browsing) {
i--;
showimg 200,hat#v(i).png,playerx,playery-2.5;
changeimgpart 200,96,0,55,55;
}
__________________
maximus_asinus
Reply With Quote
  #2  
Old 02-12-2002, 05:53 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
few things to make it better..
u should use this. variables and use this.browsing=1 instead of set browsing..
dont use flags unless ur like databasing something
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #3  
Old 02-12-2002, 07:49 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Smile

ok thanx,I know that won't make the script work,anymore help?
__________________
maximus_asinus
Reply With Quote
  #4  
Old 02-12-2002, 09:13 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
first off use keydown's in a timeout event, and dont use triggeraction

do like this

if (weaponfired) {
if (this.hatbrowsin==0) {
this.hatbrowsin=1;
timeout=.1;
} else { this.hatbrowsin=0; }
}
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #5  
Old 02-12-2002, 09:29 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
so would you say this?
if (weaponfired) {
if (this.hatbrowsin==0) {
this.hatbrowsin=1;
timeout=.1;
} else { this.hatbrowsin=0; }
}
if (keydown(1)&&timeout)&&this.hatbrowsin==1) {
i--;
showimg 200,hat#v(i).png,playerx,playery-2.5;
changeimgpart 200,96,0,55,55;
}
if (keydown(3)&&timeout)&&this.hatbrowsin==1) {
i++;
showimg 200,hat#v(i).png,playerx,playery-2.5;
changeimgpart 200,96,0,55,55;
}
or would the keydown part go before the else {this.hatbrowsin;}
__________________
maximus_asinus
Reply With Quote
  #6  
Old 02-12-2002, 09:53 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
it would be like this:

if (timeout&&this.hatbrowsin==1) {
//keydown evens here
timeout=.1; }
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #7  
Old 02-12-2002, 10:35 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
hmmm....I am stupid.Is this it?
if (weaponfired) {
if (this.hatbrowsin==0) {
this.hatbrowsin=1;
timeout=.1;
} else { this.hatbrowsin=0; }
if (timeout&&this.hatbrowsin==1) {
if (keydown(1)&&timeout&&this.hatbrowsin==1) {
i--;
showimg 200,hat#v(i).png,playerx,playery-2.5;
changeimgpart 200,96,0,55,55;
timeout =0.1;
}
if (keydown(3)&&timeout&&this.hatbrowsin==1) {
i++;
showimg 200,hat#v(i).png,playerx,playery-2.5;
changeimgpart 200,96,0,55,55;
timeout =0.1;
}
}
}
__________________
maximus_asinus
Reply With Quote
  #8  
Old 02-12-2002, 10:53 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
dont include the time and hatbrowsin thing in the keydowns


so it would be

if (timeout&&this.hatbrowsin==1) {
if (keydown(1)) {
i--;
etc., etc.
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #9  
Old 02-12-2002, 01:11 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by Kaimetsu
Also, please use the code tags so we can see the indentation. It makes things so much easier to read
makes em look a bit pertiful even if you suck at scripting too ...
Reply With Quote
  #10  
Old 02-12-2002, 02:50 PM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
Quote:
Originally posted by Kaimetsu
Also, please use the code tags so we can see the indentation. It makes things so much easier to read
Yeah i second it, Maximus interesting script, but can be improved in may ways. afraid i aint got the time to post the upgrades on here, might send them to you later
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #11  
Old 02-12-2002, 08:01 PM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
personally i used a gani for mine


but hey, whatever you want
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #12  
Old 02-13-2002, 02:47 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Unhappy

thanx for the help but the script doesn't work at all,the keydowns don't register when I press them.
__________________
maximus_asinus
Reply With Quote
  #13  
Old 02-13-2002, 02:51 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
do this
NPC Code:

if (weaponfired) {
this.hb=1;
disabledefmovement;
timeout=.1; }
if (timeout&&this.hb==1) {
if (keydown(1)) { i--; }
if (keydown(3)) { i++; }
if (keydown(5)) { enabledefmovement; this.hb=0; }
// SHOWIMG STUFF HERE
// SHOWIMG STUFF HERE
// SHOWIMG STUFF HERE
// SHOWIMG STUFF HERE
// SHOWIMG STUFF HERE
timeout=.1; }

__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #14  
Old 02-13-2002, 04:16 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Thumbs up thanx!

yesh this one works,I just have to make showimg smaller,or make it a gani,thanx for the help.
I probably will post more when I add more steps.
__________________
maximus_asinus
Reply With Quote
  #15  
Old 02-13-2002, 04:59 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
lol,

yeah i know, i just didnt feel like, was running short on time

sameasnow,betterhurry
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #16  
Old 02-13-2002, 05:52 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Thumbs up k

just a little problem,when I do hideimg when you use the S button (or keydown(5)) it doesn't hide the img,I am sure its right...
but you guys can probably tell me.
the showimg index is 200 and my hideimg index is 200.
Thats right,right?
__________________
maximus_asinus
Reply With Quote
  #17  
Old 02-13-2002, 07:52 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
you'll have to post the script for me to check
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #18  
Old 02-13-2002, 08:00 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Smile

nm I fixed it,I just added:
NPC Code:
if (this.hb==0) {
hideimg 200;
}


Pretty basic and I can't believe I couldn't think of that before
__________________
maximus_asinus
Reply With Quote
  #19  
Old 02-13-2002, 08:34 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
Quote:
Originally posted by darkriders_p2p
nm I fixed it,I just added:
NPC Code:
if (this.hb==0) {
hideimg 200;
}


Pretty basic and I can't believe I couldn't think of that before
okay, cool beans
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #20  
Old 02-14-2002, 06:57 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Smile new options

Ok,I got the basic things done,now I need some help adding the following:
-When you select a hat to where and your already wearing it,it will go off.
-And the BIG one,instead of having them all,could you help me make it so you only get first 5 for free and the rest you buy?
this is the script so far:

NPC Code:
// NPC made by SeeD Captain /\/\ãxïmus Ðärkrïdër 
if (playertouchsme) {
toweapons Hat NPC;
}
if (weaponfired) {
this.hb=1;
setani idle,;
setplayerdir down;
disabledefmovement;
timeout=.1;
}
if (timeout&&this.hb==1) {
if (keydown(1)) {
i--;
}
if (keydown(3)) {
i++;
}
if (keydown(5)) {
hideimg 200;
setstring client.hat,hat#v(i).png;
setplayerprop #P1,#s(client.hat);
setani haton,#s(client.hat);
enabledefmovement;
timeout =0.1;
this.hb=0;
}
showimg 200,hat#v(i).png,playerx-.06,playery-2;
changeimgpart 200,95,0,48,48;
timeout=.1;
if (i<0) {
i=0;
}
if (this.hb==0) {
hideimg 200;
}
}

__________________
maximus_asinus
Reply With Quote
  #21  
Old 02-14-2002, 10:23 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
do something like this
[code]
if (keydown(4)) {
if (strequals(#P(0),)) {
setplayerprop #P(0),whateverhat;
setani hat-on,;
sleep .35;
break;
} else {
setani hat-off,;
sleep .35;
setplayerprop #P(0),;
break; }
}
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #22  
Old 02-14-2002, 10:45 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
didnt test that

had to write it fast so i can finish a level, sorry if it doesn't work
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #23  
Old 02-15-2002, 01:08 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 TDK_RC6
didnt test that

had to write it fast so i can finish a level, sorry if it doesn't work
its ok your still worth your weight in fish.
__________________

!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
  #24  
Old 02-15-2002, 01:58 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
Quote:
Originally posted by Saga2001


its ok your still worth your weight in fish.
my weight in fish, what does that mean??
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #25  
Old 02-15-2002, 02:47 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Unhappy

ya it doesn't work,I have no idea what was happening there,press down and something happened? I tried to fix it but I glitched it big time.
__________________
maximus_asinus
Reply With Quote
  #26  
Old 02-15-2002, 02:57 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
Quote:
Originally posted by darkriders_p2p
ya it doesn't work,I have no idea what was happening there,press down and something happened? I tried to fix it but I glitched it big time.
well, send me the script and i'll fix it so it works

[email protected]
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #27  
Old 02-15-2002, 06:35 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 TDK_RC6


my weight in fish, what does that mean??
easy, your worth your weight in fish...duh!
__________________

!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
  #28  
Old 02-15-2002, 09:55 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
how much does fish cost per pound??
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #29  
Old 02-15-2002, 01:54 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 TDK_RC6
how much does fish cost per pound??
$12 about...
__________________

!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 07:57 AM.


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