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 12-09-2001, 09:45 AM
Knight_Vincent Knight_Vincent is offline
Registered User
Knight_Vincent's Avatar
Join Date: Aug 2001
Location: Troy, MI
Posts: 682
Knight_Vincent is on a distinguished road
Send a message via ICQ to Knight_Vincent Send a message via AIM to Knight_Vincent Send a message via Yahoo to Knight_Vincent
Question Helpo Changeo

Ok,

I have a npc that you become and can shoot with by using keydown, but when its out ammo the thing want stop shooting and i do have the if (playerbombs<0) and playerbomb-=1 in there but how would i disable the D jkey if the player bombs = 0??

-Knight_Vincent
__________________
"Did you write the Book of Love And do you have faith in God above If the Bible tells you so Do you believe in rock 'n roll Can music save your mortal soul And can you teach me how to dance real slow Well, I know that you're in love with him 'Cause I saw you dancin' in the gym You both kicked off your shoes Man, I dig those rhythm and blues I was a lonely teenage broncin' buck With a pink carnation and a pickup truck But I knew I was out of luck The day the music died" --Don McLean 'American Pie'
Reply With Quote
  #2  
Old 12-09-2001, 09:50 AM
AlexH AlexH is offline
Have A Drink On Me
AlexH's Avatar
Join Date: Jun 2001
Location: Somewhere In Time
Posts: 7,442
AlexH is on a distinguished road
Send a message via AIM to AlexH Send a message via MSN to AlexH
just use disabledefweapons and then use your keydown
__________________
QUICK LOOK BUSY JESUS IS COMING!
Reply With Quote
  #3  
Old 12-09-2001, 09:56 AM
Knight_Vincent Knight_Vincent is offline
Registered User
Knight_Vincent's Avatar
Join Date: Aug 2001
Location: Troy, MI
Posts: 682
Knight_Vincent is on a distinguished road
Send a message via ICQ to Knight_Vincent Send a message via AIM to Knight_Vincent Send a message via Yahoo to Knight_Vincent
Like This?

if (playerbombs==0) {
if (keydown(4))disableweapons;

-Knight_Vincent
__________________
"Did you write the Book of Love And do you have faith in God above If the Bible tells you so Do you believe in rock 'n roll Can music save your mortal soul And can you teach me how to dance real slow Well, I know that you're in love with him 'Cause I saw you dancin' in the gym You both kicked off your shoes Man, I dig those rhythm and blues I was a lonely teenage broncin' buck With a pink carnation and a pickup truck But I knew I was out of luck The day the music died" --Don McLean 'American Pie'
Reply With Quote
  #4  
Old 12-09-2001, 10:03 AM
AlexH AlexH is offline
Have A Drink On Me
AlexH's Avatar
Join Date: Jun 2001
Location: Somewhere In Time
Posts: 7,442
AlexH is on a distinguished road
Send a message via AIM to AlexH Send a message via MSN to AlexH
no you would disable the keys when the player entered the level/fired the NPC (depending on which way youve made the game) then do the keydown stuff
__________________
QUICK LOOK BUSY JESUS IS COMING!
Reply With Quote
  #5  
Old 12-09-2001, 10:05 AM
Knight_Vincent Knight_Vincent is offline
Registered User
Knight_Vincent's Avatar
Join Date: Aug 2001
Location: Troy, MI
Posts: 682
Knight_Vincent is on a distinguished road
Send a message via ICQ to Knight_Vincent Send a message via AIM to Knight_Vincent Send a message via Yahoo to Knight_Vincent
Um,

But how do i disable a key is what i mean.

-Knight_Vincent
__________________
"Did you write the Book of Love And do you have faith in God above If the Bible tells you so Do you believe in rock 'n roll Can music save your mortal soul And can you teach me how to dance real slow Well, I know that you're in love with him 'Cause I saw you dancin' in the gym You both kicked off your shoes Man, I dig those rhythm and blues I was a lonely teenage broncin' buck With a pink carnation and a pickup truck But I knew I was out of luck The day the music died" --Don McLean 'American Pie'
Reply With Quote
  #6  
Old 12-09-2001, 10:09 AM
AlexH AlexH is offline
Have A Drink On Me
AlexH's Avatar
Join Date: Jun 2001
Location: Somewhere In Time
Posts: 7,442
AlexH is on a distinguished road
Send a message via AIM to AlexH Send a message via MSN to AlexH
well supposing you want it to do it when you fire the NPC do it like this

NPC Code:

if (weaponfired) {
disabledefmovement;
}
if (keydown(4)) {
whatever it does;
}



just put in the keydown 4 bit a thing to check the player still has ammo or whatever it uses
__________________
QUICK LOOK BUSY JESUS IS COMING!
Reply With Quote
  #7  
Old 12-09-2001, 10:18 AM
Knight_Vincent Knight_Vincent is offline
Registered User
Knight_Vincent's Avatar
Join Date: Aug 2001
Location: Troy, MI
Posts: 682
Knight_Vincent is on a distinguished road
Send a message via ICQ to Knight_Vincent Send a message via AIM to Knight_Vincent Send a message via Yahoo to Knight_Vincent
Ok,

I want it so if i run outa ammo keydown 4 is dissabled for 15 secounds while it recharges...

-Knight_Vincent
__________________
"Did you write the Book of Love And do you have faith in God above If the Bible tells you so Do you believe in rock 'n roll Can music save your mortal soul And can you teach me how to dance real slow Well, I know that you're in love with him 'Cause I saw you dancin' in the gym You both kicked off your shoes Man, I dig those rhythm and blues I was a lonely teenage broncin' buck With a pink carnation and a pickup truck But I knew I was out of luck The day the music died" --Don McLean 'American Pie'
Reply With Quote
  #8  
Old 12-09-2001, 11:07 AM
Sennema Sennema is offline
Registered User
Join Date: Nov 2001
Location: Ontario, Canada
Posts: 132
Sennema is on a distinguished road
Send a message via ICQ to Sennema Send a message via AIM to Sennema
NPC Code:

if(playerbombs>0&&keydown(4)){
commands go here;
}
if(playerbombs==0){
timeout=15;
if(timeout){
playerbombs=99; //or whatever number
}
if(keydown(4)&&playerbombs==0){
play nextpage.wav;
}



or something to that effect. You can replace the "play nexpage.wav" to anything you want to take up time while it recharges.
__________________
~Draemus Windblade


Just over 90% of all messages have no point or meaning.

"In order to preserve ourselves we seek out and eliminate anything that may do use harm. In doing so, we destroy things that, though possibly hazzardous, may be important to survival. So you see, in trying to save ourselves, we ultimately bring about our own destruction"


Luminar
Reply With Quote
  #9  
Old 12-09-2001, 11:28 AM
Knight_Vincent Knight_Vincent is offline
Registered User
Knight_Vincent's Avatar
Join Date: Aug 2001
Location: Troy, MI
Posts: 682
Knight_Vincent is on a distinguished road
Send a message via ICQ to Knight_Vincent Send a message via AIM to Knight_Vincent Send a message via Yahoo to Knight_Vincent
Hmmm,

Well that works to regain the ammo and lose the ammo but it still does not disable keydown 4 for 15 secs

-Knight_Vincent
__________________
"Did you write the Book of Love And do you have faith in God above If the Bible tells you so Do you believe in rock 'n roll Can music save your mortal soul And can you teach me how to dance real slow Well, I know that you're in love with him 'Cause I saw you dancin' in the gym You both kicked off your shoes Man, I dig those rhythm and blues I was a lonely teenage broncin' buck With a pink carnation and a pickup truck But I knew I was out of luck The day the music died" --Don McLean 'American Pie'
Reply With Quote
  #10  
Old 12-09-2001, 11:43 AM
Sennema Sennema is offline
Registered User
Join Date: Nov 2001
Location: Ontario, Canada
Posts: 132
Sennema is on a distinguished road
Send a message via ICQ to Sennema Send a message via AIM to Sennema
how about ...
NPC Code:

if(keydown(4)&&playerbombs==0){
setani idle,; // or whatever gani/ sprite your using.
}



You can't really disable it, only make it so it doesn't do anything when pressed.
__________________
~Draemus Windblade


Just over 90% of all messages have no point or meaning.

"In order to preserve ourselves we seek out and eliminate anything that may do use harm. In doing so, we destroy things that, though possibly hazzardous, may be important to survival. So you see, in trying to save ourselves, we ultimately bring about our own destruction"


Luminar
Reply With Quote
  #11  
Old 12-09-2001, 12:05 PM
Knight_Vincent Knight_Vincent is offline
Registered User
Knight_Vincent's Avatar
Join Date: Aug 2001
Location: Troy, MI
Posts: 682
Knight_Vincent is on a distinguished road
Send a message via ICQ to Knight_Vincent Send a message via AIM to Knight_Vincent Send a message via Yahoo to Knight_Vincent
Ok,

But im not useing a gani... I haved tryed,

if (keydown(4)&&playerbombs==0)
setplayerprop #c, ...Recharging...;
timeout=15;

if (timeout)
playerbombs=99;
setplayerprop #c, ...Recharged...;

if (keydown(4)&&playerbombs<0)
function shoot() {
play effect1.wav;
shots[bllt]=ship[0]+addx;
shots[bllt+1]=ship[1]+addy;
shots[bllt+2]=addx;
shots[bllt+3]=addy;
if (bllt<maxshots*4) {bllt+=4}else{ bllt=0;
}
}

but all it does is make a lagy coppie of the ship and still lets you shoot wile it reloads . Im stumped .

-Knight_Vincent
__________________
"Did you write the Book of Love And do you have faith in God above If the Bible tells you so Do you believe in rock 'n roll Can music save your mortal soul And can you teach me how to dance real slow Well, I know that you're in love with him 'Cause I saw you dancin' in the gym You both kicked off your shoes Man, I dig those rhythm and blues I was a lonely teenage broncin' buck With a pink carnation and a pickup truck But I knew I was out of luck The day the music died" --Don McLean 'American Pie'
Reply With Quote
  #12  
Old 12-09-2001, 12:08 PM
Sennema Sennema is offline
Registered User
Join Date: Nov 2001
Location: Ontario, Canada
Posts: 132
Sennema is on a distinguished road
Send a message via ICQ to Sennema Send a message via AIM to Sennema
Quote:
Originally posted by Knight_Vincent
Ok,

But im not useing a gani... I haved tryed,

if (keydown(4)&&playerbombs==0)
setplayerprop #c, ...Recharging...;
timeout=15;

if (timeout)
playerbombs=99;
setplayerprop #c, ...Recharged...;

if (keydown(4)&&playerbombs<0)
function shoot() {
play effect1.wav;
shots[bllt]=ship[0]+addx;
shots[bllt+1]=ship[1]+addy;
shots[bllt+2]=addx;
shots[bllt+3]=addy;
if (bllt<maxshots*4) {bllt+=4}else{ bllt=0;
}
}
Ok, try this:
NPC Code:

if(playerbombs==0){
timeout=15;
}
if (keydown(4)&&playerbombs==0){
setplayerprop #c, ...Recharging...;
}
if (timeout){
playerbombs=99;
setplayerprop #c, ...Recharged...;
}
if (keydown(4)&&playerbombs>0){
function shoot() {
play effect1.wav;
shots[bllt]=ship[0]+addx;
shots[bllt+1]=ship[1]+addy;
shots[bllt+2]=addx;
shots[bllt+3]=addy;
if (bllt<maxshots*4) {bllt+=4}else{ bllt=0;
}
}


There, that should work
__________________
~Draemus Windblade


Just over 90% of all messages have no point or meaning.

"In order to preserve ourselves we seek out and eliminate anything that may do use harm. In doing so, we destroy things that, though possibly hazzardous, may be important to survival. So you see, in trying to save ourselves, we ultimately bring about our own destruction"


Luminar
Reply With Quote
  #13  
Old 12-09-2001, 12:20 PM
Knight_Vincent Knight_Vincent is offline
Registered User
Knight_Vincent's Avatar
Join Date: Aug 2001
Location: Troy, MI
Posts: 682
Knight_Vincent is on a distinguished road
Send a message via ICQ to Knight_Vincent Send a message via AIM to Knight_Vincent Send a message via Yahoo to Knight_Vincent
Hmm,

Well at least its not cloning the ship now but... the bombs go from 99 to 98 back to 99... they wont drop any further.

-Knight_Vincent
__________________
"Did you write the Book of Love And do you have faith in God above If the Bible tells you so Do you believe in rock 'n roll Can music save your mortal soul And can you teach me how to dance real slow Well, I know that you're in love with him 'Cause I saw you dancin' in the gym You both kicked off your shoes Man, I dig those rhythm and blues I was a lonely teenage broncin' buck With a pink carnation and a pickup truck But I knew I was out of luck The day the music died" --Don McLean 'American Pie'
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 08:15 AM.


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