Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Boss (https://forums.graalonline.com/forums/showthread.php?t=14282)

ownerofbabylon 10-10-2001 06:00 AM

Boss
 
as you all know I SUCK HORRIBLY as scripting. I am working on a boss for the heck of it and just wanted to show off that im actually getting better ^_^


if(created){
setgifpart roller.gif,0,0,63,49;
timeout=.5;
}
if(timeout){
if(x<playerx){rollright();}
if(y<playery){rolldown();}
if(x>playerx){rollleft();}
if(y>playery){rollup();}
timeout=.1;
}

function rollup(){
y--;
setgifpart roller.gif,0,49,63,49;
sleep .1;
y--;
setgifpart roller.gif,0,98,63,49;
sleep .1;
y--;
setgifpart roller.gif,0,147,63,49;
}

function rolldown(){
y++;
setgifpart roller.gif,63,49,63,49;
sleep .1;
y++;
setgifpart roller.gif,63,98,63,49;
sleep .1;
y++;
setgifpart roller.gif,63,147,63,49;
}

function rollleft(){
x--;
setgifpart roller.gif,189,49,63,49;
sleep .1;
x--;
setgifpart roller.gif,189,98,63,49;
sleep .1;
x--;
setgifpart roller.gif,189,147,63,49;
}

function rollright(){
x++;
setgifpart roller.gif,126,49,63,49;
sleep .1;
x++;
setgifpart roller.gif,126,98,63,49;
sleep .1;
x++;
setgifpart roller.gif,126,147,63,49;
sleep .1;
}

if(playertouchsme){
hurt 1;
timeout=.1;
}

if(washit){
timeout=.1;
}

SSRobgeta 10-10-2001 06:09 AM

Re: Boss
 
Quote:

Originally posted by ownerofbabylon
as you all know I SUCK HORRIBLY as scripting. I am working on a boss for the heck of it and just wanted to show off that im actually getting better ^_^


if(created){
setgifpart roller.gif,0,0,63,49;
timeout=.5;
}
if(timeout){
if(x<playerx){rollright();}
if(y<playery){rolldown();}
if(x>playerx){rollleft();}
if(y>playery){rollup();}
timeout=.1;
}

function rollup(){
y--;
setgifpart roller.gif,0,49,63,49;
sleep .1;
y--;
setgifpart roller.gif,0,98,63,49;
sleep .1;
y--;
setgifpart roller.gif,0,147,63,49;
}

function rolldown(){
y++;
setgifpart roller.gif,63,49,63,49;
sleep .1;
y++;
setgifpart roller.gif,63,98,63,49;
sleep .1;
y++;
setgifpart roller.gif,63,147,63,49;
}

function rollleft(){
x--;
setgifpart roller.gif,189,49,63,49;
sleep .1;
x--;
setgifpart roller.gif,189,98,63,49;
sleep .1;
x--;
setgifpart roller.gif,189,147,63,49;
}

function rollright(){
x++;
setgifpart roller.gif,126,49,63,49;
sleep .1;
x++;
setgifpart roller.gif,126,98,63,49;
sleep .1;
x++;
setgifpart roller.gif,126,147,63,49;
sleep .1;
}

if(playertouchsme){
hurt 1;
timeout=.1;
}

if(washit){
timeout=.1;
}

cool

entravial 10-10-2001 06:28 AM

~AlphaFlame~

You don't need the functions...

And this brings up an issue again: WHY do people use functions for one-time things? You use functions for MULTIPLE time things...

btedji 10-10-2001 06:51 AM

Quote:

Originally posted by entravial
~AlphaFlame~

You don't need the functions...

And this brings up an issue again: WHY do people use functions for one-time things? You use functions for MULTIPLE time things...

he does use the functions more than one time, but i think i know what you mean

this script looks like it could be optimized, but im not sure how exactly to go about doing so

ownerofbabylon 10-10-2001 07:27 AM

this was my first script that is more than making a door disappear.

btedji 10-10-2001 07:42 AM

Quote:

Originally posted by ownerofbabylon
this was my first script that is more than making a door disappear.

definitley more advanced :D

dragoonvenganc 10-10-2001 09:41 AM

Yes in his script they are used once just repeated so he does not need the functions..

entravial 10-11-2001 06:46 AM

~AlphaFlame~

Sure, Kaimetsu. If you say so. Guess I'll just be doing this then:

if (playertouchsme){
Hide();
Sleep();
Show();
}
function Hide(){
hide;
}
function Sleep(){
sleep .5;
}
function Show(){
show;
}

:rolleyes:

btedji 10-11-2001 09:48 AM

Quote:

Originally posted by entravial
~AlphaFlame~

Sure, Kaimetsu. If you say so. Guess I'll just be doing this then:

if (playertouchsme){
Hide();
Sleep();
Show();
}
function Hide(){
hide;
}
function Sleep(){
sleep .5;
}
function Show(){
show;
}

:rolleyes:

LOL thats just messed now

pezi 10-11-2001 07:48 PM

Re: Boss
 
Quote:

Originally posted by ownerofbabylon
as you all know I SUCK HORRIBLY as scripting. I am working on a boss for the heck of it and just wanted to show off that im actually getting better ^_^


if(created){
setgifpart roller.gif,0,0,63,49;
timeout=.5;
}
if(timeout){
if(x<playerx){rollright();}
if(y<playery){rolldown();}
if(x>playerx){rollleft();}
if(y>playery){rollup();}
timeout=.1;
}

function rollup(){
y--;
setgifpart roller.gif,0,49,63,49;
sleep .1;
y--;
setgifpart roller.gif,0,98,63,49;
sleep .1;
y--;
setgifpart roller.gif,0,147,63,49;
}

function rolldown(){
y++;
setgifpart roller.gif,63,49,63,49;
sleep .1;
y++;
setgifpart roller.gif,63,98,63,49;
sleep .1;
y++;
setgifpart roller.gif,63,147,63,49;
}

function rollleft(){
x--;
setgifpart roller.gif,189,49,63,49;
sleep .1;
x--;
setgifpart roller.gif,189,98,63,49;
sleep .1;
x--;
setgifpart roller.gif,189,147,63,49;
}

function rollright(){
x++;
setgifpart roller.gif,126,49,63,49;
sleep .1;
x++;
setgifpart roller.gif,126,98,63,49;
sleep .1;
x++;
setgifpart roller.gif,126,147,63,49;
sleep .1;
}

if(playertouchsme){
hurt 1;
timeout=.1;
}

if(washit){
timeout=.1;
}

I saw the boss :D

Enigma_GP6 10-13-2001 02:53 AM

Here isd something, I guess I'll have to demoralize myself down to Helmut's level, here goes nothing.

//Starts Here
timeout=0.05;
if (playerenters||timeout||washit||wasshot||playercha ts||exploded){
bigboom();
this.boomed,5;
timeout=0.05;
}
if (this.boom>15){
bigboom();
timeout=0.05;
}
function bigboom(){
if (timeout){
putleaps 0,playerx,playery;
putexplosion 2,int.random(playerx-3),int.random(playery-3);
putexplosion 2,int.random(playerx+3),int.random(playery+3);
timeout=0.05;
this.boomed++;
}
}
//Ends Here


Gosh, that took like, what, 0.05 seconds?

-Rebel95 -DND- -Working Heavily on Server-

Enigma_GP6 10-13-2001 02:58 AM

Maybe I buddged that up a little too much.


-Rebel95 -DND- -Working heavily on Server-

btedji 10-13-2001 04:16 AM

Quote:

Originally posted by Enigma_GP6
Maybe I buddged that up a little too much.


-Rebel95 -DND- -Working heavily on Server-

this.boomed,5; is messed up, easily fixed :D


All times are GMT +2. The time now is 06:32 PM.

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