PDA

View Full Version : I need the a script!


Termina_GP7
05-10-2001, 07:35 AM
i need someone to make a beach ball that when you hit it it will fly up in the air and it only works in water please reply

05-20-2001, 04:01 AM
Well, I made all that I can of that script, I tryed to do the bouncing part but it didn't work out so good.



// NPC made by Ice Pick
canbecarried;

//left wall action
if(onwall(x,y) && !onwall(x+4,y))
{
x+=1.5;
y+=.25;
sleep .05;
x+=1.4;
y+=.25;
sleep .05;
x+=1.3;
y+=.25;
sleep .05;
x+=1.2;
y+=.25;
sleep .05;
x+=1.06;
y+=.25;
sleep .05;
x+=.9;
y+=.25;
sleep .05;
x+=.7;
y+=.25;
sleep .05;
x+=.5;
y+=.25;
sleep .05;
//bounce again...
x+=.3;
y-=.5;
sleep .05;
x+=.3;
y-=.35;
sleep .05;
x+=.3;
y-=.15;
sleep .05;
x+=.3;
y-=.05;
sleep .05;
x+=.3;
y+=.05;
sleep .05;
x+=.3;
y+=.15;
sleep .05;
x+=.3;
y+=.35;
sleep .05;
x+=.3;
y+=.5;
sleep .05;

}


//right wall action
if(onwall(x+2,y) && !onwall(x-2,y))
{
x-=1.5;
y+=.25;
sleep .05;
x-=1.4;
y+=.25;
sleep .05;
x-=1.3;
y+=.25;
sleep .05;
x-=1.2;
y+=.25;
sleep .05;
x-=1.06;
y+=.25;
sleep .05;
x-=.9;
y+=.25;
sleep .05;
x-=.7;
y+=.25;
sleep .05;
x-=.5;
y+=.25;
sleep .05;
//bounce again...
x-=.3;
y-=.5;
sleep .05;
x-=.3;
y-=.35;
sleep .05;
x-=.3;
y-=.15;
sleep .05;
x-=.3;
y-=.05;
sleep .05;
x-=.3;
y+=.05;
sleep .05;
x-=.3;
y+=.15;
sleep .05;
x-=.3;
y+=.35;
sleep .05;
x-=.3;
y+=.5;
sleep .05;

}



//top wall action
if(onwall(x,y+1.5) && !onwall(x,y+5))

{
y+=1.5;
sleep .05;
y+=1.4;
sleep .05;
y+=1.3;
sleep .05;
y+=1.2;
sleep .05;
y+=1.06;
sleep .05;
y+=.9;
sleep .05;
y+=.7;
sleep .05;
y+=.5;
sleep .05;
//bounce again...
y+=.05;
sleep .05;
y+=.1;
sleep .05;
y+=.15;
sleep .05;
y+=.2;
sleep .05;
y+=.25;
sleep .05;
y+=.3;
sleep .05;
y+=.35;
sleep .05;
y+=.4;
sleep .05;

}

//bottom wall action
if(onwall(x,y+4) && !onwall(x,y))

{
y-=1.5;
sleep .05;
y-=1.4;
sleep .05;
y-=1.3;
sleep .05;
y-=1.2;
sleep .05;
y-=1.06;
sleep .05;
y-=.9;
sleep .05;
y-=.7;
sleep .05;
y-=.5;
sleep .05;
//bounce again...
y-=.05;
sleep .05;
y-=.1;
sleep .05;
y-=.15;
sleep .05;
y-=.2;
sleep .05;
y-=.25;
sleep .05;
y-=.3;
sleep .05;
y-=.35;
sleep .05;
y-=.4;
sleep .05;

}
//TEST FOR END OF MAP!
//left wall action
if(x < 2)
{
x+=1.5;
y+=.25;
sleep .05;
x+=1.4;
y+=.25;
sleep .05;
x+=1.3;
y+=.25;
sleep .05;
x+=1.2;
y+=.25;
sleep .05;
x+=1.06;
y+=.25;
sleep .05;
x+=.9;
y+=.25;
sleep .05;
x+=.7;
y+=.25;
sleep .05;
x+=.5;
y+=.25;
sleep .05;
//bounce again...
x+=.3;
y-=.5;
sleep .05;
x+=.3;
y-=.35;
sleep .05;
x+=.3;
y-=.15;
sleep .05;
x+=.3;
y-=.05;
sleep .05;
x+=.3;
y+=.05;
sleep .05;
x+=.3;
y+=.15;
sleep .05;
x+=.3;
y+=.35;
sleep .05;
x+=.3;
y+=.5;
sleep .05;

}


//right wall action
if(x > 62)
{
x-=1.5;
y+=.25;
sleep .05;
x-=1.4;
y+=.25;
sleep .05;
x-=1.3;
y+=.25;
sleep .05;
x-=1.2;
y+=.25;
sleep .05;
x-=1.06;
y+=.25;
sleep .05;
x-=.9;
y+=.25;
sleep .05;
x-=.7;
y+=.25;
sleep .05;
x-=.5;
y+=.25;
sleep .05;
//bounce again...
x-=.3;
y-=.5;
sleep .05;
x-=.3;
y-=.35;
sleep .05;
x-=.3;
y-=.15;
sleep .05;
x-=.3;
y-=.05;
sleep .05;
x-=.3;
y+=.05;
sleep .05;
x-=.3;
y+=.15;
sleep .05;
x-=.3;
y+=.35;
sleep .05;
x-=.3;
y+=.5;
sleep .05;

}



//top wall action
if(y < 2)

{
y+=1.5;
sleep .05;
y+=1.4;
sleep .05;
y+=1.3;
sleep .05;
y+=1.2;
sleep .05;
y+=1.06;
sleep .05;
y+=.9;
sleep .05;
y+=.7;
sleep .05;
y+=.5;
sleep .05;
//bounce again...
y+=.05;
sleep .05;
y+=.1;
sleep .05;
y+=.15;
sleep .05;
y+=.2;
sleep .05;
y+=.25;
sleep .05;
y+=.3;
sleep .05;
y+=.35;
sleep .05;
y+=.4;
sleep .05;

}

//bottom wall action
if(y > 62)

{
y-=1.5;
sleep .05;
y-=1.4;
sleep .05;
y-=1.3;
sleep .05;
y-=1.2;
sleep .05;
y-=1.06;
sleep .05;
y-=.9;
sleep .05;
y-=.7;
sleep .05;
y-=.5;
sleep .05;
//bounce again...
y-=.05;
sleep .05;
y-=.1;
sleep .05;
y-=.15;
sleep .05;
y-=.2;
sleep .05;
y-=.25;
sleep .05;
y-=.3;
sleep .05;
y-=.35;
sleep .05;
y-=.4;
sleep .05;

}

if(playerchats)
{
if (strcontains(#c,recoverred))
{
if(playerdir==0)
{
x=playerx;
y=playery-4;
}
if(playerdir==1)
{
x=playerx-4;
y=playery;
}
if(playerdir==3)
{
x=playerx+4;
y=playery;
}
if(playerdir==2)
{
x=playerx;
y=playery+4;
}

}
}
if (playerenters) {
}
if (playertouchsme) {
set ballisheld;

if(onwater(x,y))
{
//vars for player so ball doesn't dynamically update player pos
myy=players[player].y;
myx=players[player].x;
y-=(myy-y)/5;
x-=(myx-x)/5;
sleep .05;
y-=(myy-y)/6;
x-=(myx-x)/6;
sleep .05;
y-=(myy-y)/7;
x-=(myx-x)/7;
sleep .05;
y-=(myy-y)/8;
x-=(myx-x)/8;
sleep .05;
y-=(myy-y)/9;
x-=(myx-x)/9;
sleep .05;
y-=(myy-y)/12;
x-=(myx-x)/12;
sleep .05;
y-=(myy-y)/16;
x-=(myx-x)/16;
sleep .05;
y-=(myy-y)/20;
x-=(myx-x)/20;
sleep .05;
y-=(myy-y)/25;
x-=(myx-x)/25;
sleep .05;
}
}


if (washit) {

//vars for player so ball doesn't dynamically update player pos
myy=players[player].y;
myx=players[player].x;
//If character is sort of below the NPC
y-=(myy-y)/5;
x-=(myx-x)/5;
sleep .05;
y-=(myy-y)/6;
x-=(myx-x)/6;
sleep .05;
y-=(myy-y)/7;
x-=(myx-x)/7;
sleep .05;
y-=(myy-y)/8;
x-=(myx-x)/8;
sleep .05;
y-=(myy-y)/9;
x-=(myx-x)/9;
sleep .05;
y-=(myy-y)/12;
x-=(myx-x)/12;
sleep .05;
y-=(myy-y)/16;
x-=(myx-x)/16;
sleep .05;
y-=(myy-y)/20;
x-=(myx-x)/20;
sleep .05;
y-=(myy-y)/25;
x-=(myx-x)/25;
sleep .05;


}

if(wasthrown)
{
sleep 1;
if(dir==0)
{
y-=.05;
sleep .05;
y-=.1;
sleep .05;
y-=.15;
sleep .05;
y-=.2;
sleep .05;
y-=.25;
sleep .05;
y-=.3;
sleep .05;
y-=.35;
sleep .05;
y-=.4;
sleep .05;
}
}

kyle0654
05-20-2001, 04:03 AM
*trembling, takes out bottle of pills, shakes some into hand, then stuffs them down his throat...and shakes uncontrollably*

Lion'el-Jonson
05-20-2001, 04:32 AM
::scratches head::

Cyboars
05-20-2001, 04:44 AM
*falls over*
*eyes fall out of sockets*
Holy....
*passes out from lack of scripting powers, and ability to withstand the shock of an immense script*

freddyfox
05-20-2001, 06:25 AM
Originally posted by IcePick_2001
Well, I made all that I can of that script, I tryed to do the bouncing part but it didn't work out so good.

[/code]


AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!

*Motions for kyle to hand him some of those pills*

I MUST NOW GOUGE MY EYEBALLS OUT!

kyle0654
05-20-2001, 06:33 AM
*looks at script again*
*runs to kitchen, takes out bag of salt, and pours in eyes, then slowly crawls back to computer, curls up in a small ball on the floor, and twitches insanely*

CrazedMerlin
05-20-2001, 10:03 AM
did ice pick say he MADE a script?
OMGOMGOMG
its a first

_Shoey_Fighter_
05-20-2001, 11:45 AM
I've always wondered why people never use the for command...

But, it is nice seeing Icepick trying to help out for a change... ;)

entravial
05-20-2001, 03:50 PM
umm, who's a script??

j/k
------
Entravial (Bravo NAT)

05-20-2001, 11:05 PM
Yes, I did make that script. Why do you ask? :confused:

CrazedMerlin
05-21-2001, 12:21 AM
Eh...
Its a little big :D

05-21-2001, 01:17 AM
Yes I know, But once you get the first 50 lines or so done, It gets very easy.

bb2k1
05-21-2001, 02:06 AM
IcePick, the script is crap. It's horribley coded and doesn't need to be nearly
that long.

LiquidIce00
05-21-2001, 12:31 PM
Ice_Pick..
get in touch with your sine and cosine and loops.
it makes it alot easier and alot better effect.
and with sine / cosine you would be able to change 'force' and such making how far it travels and stuff like that..
:cool:

bb2k1
05-22-2001, 06:51 AM
ALOT!

Lugie
05-22-2001, 07:20 AM
its mainly just changing the x,y of the ball, its not that hard, it just takes a while ;-)

entravial
05-22-2001, 04:22 PM
At least he was giving it a go!

I don't know anything about the harder maths side of scripting as im only 11, but I still manage

aran_lesai
05-22-2001, 08:49 PM
Not too bad, icepick. Some suggestions: use sine/cosine and for statements. The script could also be made shorter by putting multiple commands on one line (since a lot of them are similar).
Stefan should add calculus functions to Graal, for more complex animations (like walking past a lamp post, the shadow moves).
Beleive it or not, the hard part about calculus is the algebra, not the actual calculus (integrals and derivatives).
This scares me. There are 11 year olds into programming! But then again, I was programming in LOGO on an apple IIc in second grade. That is really cool how young people are doing way-cool stuff now days with computers. I know a 12 year old with his own business!
NE way, don't be so mean to Icepick. Without him, we wouldn't have the NPC server document (thanks btw). Scripting is hard to master, but you get better as you go. It at least gives the bouncing effect. Oh, it could also be shortened by defining functions. Then you wouldn't have to repeat the script.
C yall L8R

aran_lesai
05-22-2001, 10:52 PM
Thanks for the play by play commentary.Please tell me that was sarcasm. Noooooooo, that can't be sarcasm? Really? I'm glad you told me! (j/k)Efficiency is not decided by line counts. Two commands on one line is the same as one command on two lines.Your right.Which calculus do you mean? Integration and suchlike can be done prior to the actual scripting, so I can't see anywhere where you'd need a calculus function.Single Variable Calculus, so you can do complex movements and animations. Just for specific instances, like a person walking past a lamp post and his shadow moves according to where he is and how fast he is moving. You need calculus to do that.Ah, but how advanced are you getting here? Arguably calculus is a branch of algebra, but if we do split them up then I'd say advanced calculus is MUCH harder than standard algebra. Example: Reduction formulae. You often have to try many different approaches before these actually work. This is low level calculus, mainly integrals and derivatives of a single variable. The actual calculus involved is very simple: it is just a bit of memorization. The algebra involved with the basic calculus functions is complicated. That is what I meant. What calculus are u taking?I'm kinda ashamed. I'm 17, I started programming at 15, and I kinda feel like I started too late. Still, even newbie scripters like me can get some good results.Don't be. It's never too late to start. I am 19 and I'm new to this type of scripting as well (isn't it C++ or something), but I totally kick butt in Vbasic. I love trying to come up with original NPC's. I am rather pleased with them (if I say so myself).That might not be an entirely good thing. Yet again, I'm never sarcastic ;).It can be easy, but it just takes a while. I'd say nobody so far has really mastered it. True. Again I am also a n00b at graalscript. It gets easier, but can NE1 really master it if it keeps changing/growing (thanks Stefan :))?<---- for once I'm serious.Dirgo would also be fun.OK, wtf is dirgo???

2 can play at that game, Kaimetsu :p

aran_lesai
05-24-2001, 01:05 PM
That's what I do. Makes it easier to argue. I've noticed. I'm not like stealing a trademark or anything, am I? If I am, I'll quit.
Explain how you need calculus.You need calculus to determine the exact position of the shadow based on the person's walking speed and change in postition. We did excercises like that in my calc. class.Ah, I agree entirely. Increase the exponent and divide by it, etc. The rules are simple but they do get worse.Yep.I could tell you but you wouldn't know what I was talking about because the English classifications are probably way different to those wherever you are. If it'll help, I'm doing stuff like solving second-order diff. equations and reduction formulae.OK, that's like the same I was doing.Oh, I know I'm new but I didn't say I wasn't good. Those Drakkara are one example of my skills. What kind of stuff have you done in VBasic? Any games?The Drakkara rock! (For more info, ppl, see his Drakkara thread under "new races") Actually it has been a while since I've done any heave programming. I had a small, icon-based rpg, but it's long since deleted. I once made an analogue clock by hand in Qbasic, and then transfered and updated the code into Vbasic.Actually, the term "newbie" is debatable. In terms of time, I'm a newbie. Bu I've learned quickly enough to be classed as an oldbie regardless of how long I've been doing it.Kinda like me. I tend to be a quick study, and I'm currently making some really unique (if not complicated) NPC's. To be honest, I'm just getting back into it, after being of Graal for a year. I was on Graal1.3x and did lotsa stuff back then. Plus, quality of work is better than how long you've been doing it (I think qualtiy over quantity is better.)A characteristic array usually used in Graal scripts to help with directions. Though it was kinda replaced with the new commands (I forget their names... Something like VelX/VelY?).Ok. I now know what u r talking about. The word just kinda threw me off.Good, it's a fun game:) lol!

entravial
05-25-2001, 05:28 PM
i really have no idea how you could be bothered doing that commentary thingy.

scripting is alright, i do a bit of it, but id rather just play the game

entravial
05-29-2001, 06:23 PM
you do have a point.

most of the scripting i do is just odds and ends,
sometimes ill make a project or something

aran_lesai
05-31-2001, 09:07 PM
I agree, Kaimetsu. The customizability--making my own graphics, characters, and even whole worlds--is all part of what draws me to Graal. It allows ppl to make it almost literally "their own game", with a bit of help from Stefan and others. This is what makes Graal so different than other games. It gives us a chance to make it fit our specifications, instead of just the game creator's. Player input is, IMO, the single most defining characteristic of Graal. It gives all of us a chance to show our creativity, by doing something we're good at.

toad1413
06-06-2001, 07:53 PM
Originally posted by aran_lesai
I agree, Kaimetsu. The customizability--making my own graphics, characters, and even whole worlds--is all part of what draws me to Graal. It allows ppl to make it almost literally "their own game", with a bit of help from Stefan and others. This is what makes Graal so different than other games. It gives us a chance to make it fit our specifications, instead of just the game creator's. Player input is, IMO, the single most defining characteristic of Graal. It gives all of us a chance to show our creativity, by doing something we're good at.

How true. *Smiles and thinks about scripting, then realises he's not that good at it*

TB3
06-06-2001, 09:18 PM
IcePick_2001

Yes I know, But once you get the first 50 lines or so done, It gets very easy.

:eek: OMG I cant believe you would use something like that what are u thinking what am i thinking i think seeing that droped my iq about 15 points what the hell where u thinking omg couldnt you.... ahhh that man no .. **** what? no why? how mind need kyle's pills ... script too .... 600 lines long too no dont *passes out*