Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-15-2001, 12:58 PM
SabreKnot SabreKnot is offline
Registered User
SabreKnot's Avatar
Join Date: Nov 2001
Posts: 524
SabreKnot is on a distinguished road
Question Beer Script (help w/ strings)

Ok. I am working on a beer script but I need some help. Anyways, here is what i have so far...

//Beer made by Raine

if (hasbeer) {replaceani idle,rainebeer; replaceani walk, rainebeerwalk;replaceani sit,rainesitbeer}

while (six=S && hasbeer){disableweapons;
if (keydown(6)) {setani rainedrinkbeer,;sleep 1;set drank}
if (drank) {
i = random(0,4);
if (i in <0,2>) setani rainedrankbeer,;
else if (i in <2,3>) setani rainedrunkbarf,;
else if (i in <3,4>) setani rainedrankitok, ;} sleep .05;unset drank;}

Anyways, i need help. I want it so after you drink 5 times you lose the beer (change ganis back to reg. walk,idle,sit;unset the hasbeer) and also if you passout (rainedrunkbarf ganis) you stay on the ground for 6 seconds and lose the beer even if you havent drank 5. Anyways, any help is megapreciated. Peace.
Reply With Quote
  #2  
Old 11-15-2001, 09:14 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
Re: Beer Script (help w/ strings)

Quote:
Originally posted by SabreKnot
Ok. I am working on a beer script but I need some help. Anyways, here is what i have so far...

//Beer made by Raine

if (hasbeer) {replaceani idle,rainebeer; replaceani walk, rainebeerwalk;replaceani sit,rainesitbeer}

while (six=S && hasbeer){disableweapons;
if (keydown(6)) {setani rainedrinkbeer,;sleep 1;set drank}
if (drank) {
i = random(0,4);
if (i in <0,2>) setani rainedrankbeer,;
else if (i in <2,3>) setani rainedrunkbarf,;
else if (i in <3,4>) setani rainedrankitok, ;} sleep .05;unset drank;}

Anyways, i need help. I want it so after you drink 5 times you lose the beer (change ganis back to reg. walk,idle,sit;unset the hasbeer) and also if you passout (rainedrunkbarf ganis) you stay on the ground for 6 seconds and lose the beer even if you havent drank 5. Anyways, any help is megapreciated. Peace.
just do:


//Beer made by GÄ$†£Ÿ

if (hasbeer) {replaceani idle,rainebeer; replaceani walk, rainebeerwalk;replaceani sit,rainesitbeer}

while (six=S && hasbeer){disableweapons;
if (keydown(6)&&this.drink<=5) {
this.drink+=1;
setani rainedrinkbeer,;sleep 1;set drank}
if (drank) {
i = random(0,4);
if (i in <0,2>) setani rainedrankbeer,;
else if (i in <2,3>) setani rainedrunkbarf,;
else if (i in <3,4>) setani rainedrankitok, ;} sleep .05;unset drank;}
if (this.drink==5) {
replaceani sit,sit;
replaceani walk,walk;
replaceani idle,idle;
destroy;
}
__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #3  
Old 11-15-2001, 10:55 PM
SabreKnot SabreKnot is offline
Registered User
SabreKnot's Avatar
Join Date: Nov 2001
Posts: 524
SabreKnot is on a distinguished road
it didnt work. I think it may be another npc in my level or something. Here's my bar with all the pics if anyone wants to take a crack.
Attached Files
File Type: zip anarchybar.zip (20.3 KB, 132 views)
Reply With Quote
  #4  
Old 11-16-2001, 05:00 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

1- Learn to script better
2- Don't use flags for that kind of stuff.
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #5  
Old 11-16-2001, 09:08 AM
SabreKnot SabreKnot is offline
Registered User
SabreKnot's Avatar
Join Date: Nov 2001
Posts: 524
SabreKnot is on a distinguished road
What do you suggest i use then?
Reply With Quote
  #6  
Old 11-16-2001, 09:13 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

You could take some time to learn this. variables...

while (six=S) .... err... I'll trust that that's some kind of hidden built-in variable that is has text as the assigned value...
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #7  
Old 11-16-2001, 09:19 AM
SabreKnot SabreKnot is offline
Registered User
SabreKnot's Avatar
Join Date: Nov 2001
Posts: 524
SabreKnot is on a distinguished road
Yeah i was thinking that I should need variables for this. Is there any place that has some tutorial or quick view to variables because I have no idea how they work, i still dont know how strings work very well x.X
Reply With Quote
  #8  
Old 11-16-2001, 09:23 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~


Try Ace's newbie scripting bible. It's in the www.graal2001.com library section, under NPC Scripting.
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #9  
Old 11-16-2001, 11:15 AM
SabreKnot SabreKnot is offline
Registered User
SabreKnot's Avatar
Join Date: Nov 2001
Posts: 524
SabreKnot is on a distinguished road
//Beer made by Raine
//with Help from Gastey and Sage.

if (hasbeer) {
replaceani idle,rainebeer;
replaceani walk, rainebeerwalk;
replaceani sit,rainesitbeer;}

if (playertouchsme) {
set hasbeer;}

while (zero==0 && hasbeer){
disableweapons;
if (keydown(6)&&this.drink<5) {
this.drink+=1;
setani rainedrinkbeer,;
sleep 1;
set drank;}

if (drank) {
i = random(0,4);
if (i in <0,2> ) setani rainedrankbeer,;
else if (i in <2,3> ) setani rainedrunkbarf,;
else if (i in <3,4> ) setani rainedrankitok, ;}
unset drank;
if (this.drink==5) {
unset hasbeer;
replaceani sit,sit;
replaceani walk,walk;
replaceani idle,idle; sleep .05;
this.drink==0;enableweapons}
sleep .05;}

There we go. Perfect . Ok, new goal. How can I make it so if your gani is rainedrunkbarf (the passout ganis) you stay on the floor for 6 seconds and then lose the beer? I know it has something to do with making this.drink==5 but I dont know how for it to detect the ganis is rainedrunkbarf for it to work.
Reply With Quote
  #10  
Old 11-16-2001, 08:35 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
if (hasbeer) {
replaceani idle,rainebeer;
replaceani walk, rainebeerwalk;
replaceani sit,rainesitbeer;}

if (playertouchsme) {
set hasbeer;}

while (zero==0 && hasbeer){
disableweapons;
if (keydown(6)&&this.drink<5) {
this.drink+=1;
setani rainedrinkbeer,;
sleep 1;
set drank;}

if (drank) {
i = random(0,4);
if (i in <0,2> ) setani rainedrankbeer,;
else if (i in <2,3> ) {setani rainedrunkbarf,; freezeplayer 6; this.drink==5}
else if (i in <3,4> ) setani rainedrankitok, ;}
unset drank;
if (this.drink==5) {
unset hasbeer;
replaceani sit,sit;
replaceani walk,walk;
replaceani idle,idle; sleep .05;
this.drink==0;enableweapons}
sleep .05;}


Try that, it might not work but try
__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #11  
Old 11-16-2001, 10:04 PM
SabreKnot SabreKnot is offline
Registered User
SabreKnot's Avatar
Join Date: Nov 2001
Posts: 524
SabreKnot is on a distinguished road
Nope. I also tried:

if (hasbeer) {
replaceani idle,rainebeer;
replaceani walk, rainebeerwalk;
replaceani sit,rainesitbeer;}

if (playertouchsme) {
set hasbeer;}

while (zero==0 && hasbeer){
disableweapons;
if (keydown(6)&&this.drink<5) {
this.drink+=1;
setani rainedrinkbeer,;
sleep 1;
set drank;}

if (drank) {
i = random(0,4);
if (i in <0,2> ) setani rainedrankbeer,;
else if (i in <3,4> ) setani rainedrankitok, ;
else if (i in <2,3> ) {setani rainedrunkbarf,; disabledefmovement;sleep 5;this.drink==5;enabledefmovement;replaceani sit,sit;
replaceani walk,walk;
replaceani idle,idle};
}
unset drank;
if (this.drink==5) {
unset hasbeer;
replaceani sit,sit;
replaceani walk,walk;
replaceani idle,idle; sleep .05;
this.drink==0;enableweapons}
sleep .05;}

but it would make it so i couldnt move (but could drink) for 5 seconds after no matter what result came out and id lose the beer.
Reply With Quote
  #12  
Old 11-17-2001, 02:43 AM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
change "i in <3,4>" to "i in |3,4|"
Reply With Quote
  #13  
Old 11-17-2001, 06:50 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

You're still setting flags...

ok, I'll emphasize this. YOU DO NOT NEED ANY FLAGS FOR THIS SCRIPT
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #14  
Old 11-17-2001, 09:00 AM
SabreKnot SabreKnot is offline
Registered User
SabreKnot's Avatar
Join Date: Nov 2001
Posts: 524
SabreKnot is on a distinguished road
Ok I took out the flags, lol.

Also the |3,4| thing works but it will bug up and do like .5 of the passout thing but change to the rainedrankok gani but it will still freeze you for 6 seconds.
Reply With Quote
  #15  
Old 11-17-2001, 08:32 PM
Xythar Xythar is offline
Banned
Xythar's Avatar
Join Date: Aug 2001
Location: NOT (quite) HERE
Posts: 1,241
Xythar is on a distinguished road
Send a message via AIM to Xythar Send a message via Yahoo to Xythar
Freezeplayer?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:32 AM.


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