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
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 04:29 AM.


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