Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Beer Script (help w/ strings) (https://forums.graalonline.com/forums/showthread.php?t=16982)

SabreKnot 11-15-2001 12:58 PM

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.

mhermher 11-15-2001 09:14 PM

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;
}

SabreKnot 11-15-2001 10:55 PM

1 Attachment(s)
:( 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.

entravial 11-16-2001 05:00 AM

~AlphaFlame~

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

SabreKnot 11-16-2001 09:08 AM

What do you suggest i use then? :confused:

entravial 11-16-2001 09:13 AM

~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...

SabreKnot 11-16-2001 09:19 AM

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

entravial 11-16-2001 09:23 AM

~AlphaFlame~


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

SabreKnot 11-16-2001 11:15 AM

//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 :p. 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.

mhermher 11-16-2001 08:35 PM

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

SabreKnot 11-16-2001 10:04 PM

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.

Slaktmaster 11-17-2001 02:43 AM

change "i in <3,4>" to "i in |3,4|"

entravial 11-17-2001 06:50 AM

~AlphaFlame~

You're still setting flags...

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

SabreKnot 11-17-2001 09:00 AM

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.

Xythar 11-17-2001 08:32 PM

Freezeplayer?


All times are GMT +2. The time now is 02:07 PM.

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