Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   i need 2 know how 2 script a dance floor (https://forums.graalonline.com/forums/showthread.php?t=51234)

crazy_dude92 02-21-2004 03:10 AM

i need 2 know how 2 script a dance floor
 
Is it easy to script a dance floor, or a trampoline?
It would be nice if someone could explain me how to script such, or perhaps a gun, or a train, lol.

Loriel 02-21-2004 04:43 AM

That is not the way to learn scripting.
Have a look at the available commands, and read through existing scripts, in order to understand how you can achieve things and how to interact with the game engine.
Asking questions like these does not really help.

R0bin 02-21-2004 04:45 AM

I believe there is a rule that states "Do not ask for scripts"

I think you should read them :)

Loriel 02-21-2004 04:53 AM

I think the original poster is just trying to learn.

SlikRick 02-21-2004 05:00 AM

1 Attachment(s)
This will help you out on your scripting...helped me out alot.

WanDaMan 02-21-2004 11:17 AM

Quote:

Originally posted by SlikRick
This will help you out on your scripting...helped me out alot.
He just wants the script, he isn't going to learn any of it :\
Good of you to attach it though :-)

SlikRick 02-21-2004 12:02 PM

Well its better to learn so you know what to do and how to use what properly so the next time they script they wont have to ask for that much help. It really goes into depth about each command and how to use em =X

osrs 02-21-2004 03:48 PM

Just change player's directions and movements randomly in a determined place. It's not that hard.

Destorm 02-21-2004 05:08 PM

Dance -
Use :-
If
playerx in ||
playery in ||
setplayer ani

Gun :-
If
setplayer ani
Shoot
actionprojectile (serverside)

Train :-
If
setplayerani
playerx
playery
for

osrs 02-21-2004 05:46 PM

Quote:

Originally posted by Destorm
<commands />
It's setani not setplayerani. Also, actionprojectile events work not only server-side but client-side too.
Don't you think that he'll need to use 'if' since he will have to call an event on his script? (lol?)

ZeLpH_MyStiK 02-21-2004 08:28 PM

Got bored so...
Dance:
NPC Code:

//#CLIENTSIDE
if (playerenters) timeout=.05;
if (timeout) {
if ((playerx in |0,32|) && (playery in |0,64|)) { //play with the numbers i made it work for the left half of the level
playersprite=int(random(0,41));
}
timeout=.5;
}


osrs 02-21-2004 11:09 PM

Quote:

Originally posted by ZeLpH_MyStiK
Got bored so...
Dance:
NPC Code:

..
playersprite=int(random(0,41));
..


playersprite is kinda "deprecated" since when Graal2001 was released. Ganis are probably the best solution. I would probably create a string with the ganis and use random(#) for the randomly movements.

WanDaMan 02-21-2004 11:14 PM

This thread makes me remenisc the past...
I loved that script what Cynadine made :p

ZeLpH_MyStiK 02-23-2004 03:32 AM

Quote:

Originally posted by osrs


playersprite is kinda "deprecated" since when Graal2001 was released. Ganis are probably the best solution. I would probably create a string with the ganis and use random(#) for the randomly movements.

lol look at your method and mine...which one is easier? xD

Dach 02-23-2004 05:10 AM

Quote:

Originally posted by ZeLpH_MyStiK

lol look at your method and mine...which one is easier? xD

I'll always use sprites before I make a gani, less work + less files = happier me

Deek2 02-23-2004 08:04 AM

Why not go through with him the structure of the actual script (what needs to be what, how and where and why) without actually telling him the actual script? It's a good way of teaching him to learn, because he still has to actually script it out all by himself.

WanDaMan 02-23-2004 10:12 AM

Quote:

Originally posted by Deek2
Why not go through with him the structure of the actual script (what needs to be what, how and where and why) without actually telling him the actual script? It's a good way of teaching him to learn, because he still has to actually script it out all by himself.
I guess, but what is the point when he hasn't replied? :(

ZeLpH_MyStiK 02-23-2004 10:57 PM

Quote:

Originally posted by Deek2
Why not go through with him the structure of the actual script (what needs to be what, how and where and why) without actually telling him the actual script? It's a good way of teaching him to learn, because he still has to actually script it out all by himself.
I did leave comments...most of it is pretty much self-explanatory

osrs 02-24-2004 01:06 AM

Quote:

Originally posted by ZeLpH_MyStiK

lol look at your method and mine...which one is easier? xD


NPC Code:

if(playersays(Hi)) message Hi;



NPC Code:

if(playerchats && strequals(#c,Hi)) message Hi;



Wich one is easier and wich one is most efficient?
Think about it.

dlang 02-24-2004 02:25 AM

Quote:

Originally posted by Loriel
That is not the way to learn scripting.
Have a look at the available commands, and read through existing scripts, in order to understand how you can achieve things and how to interact with the game engine.
Asking questions like these does not really help.

I learned most of what i know about scripting by taking apart other scripts to see how they work. So don't go on saying that stuff because you're not always right :O

ZeLpH_MyStiK 02-24-2004 03:17 AM

Quote:

Originally posted by osrs



NPC Code:

if(playersays(Hi)) message Hi;



NPC Code:

if(playerchats && strequals(#c,Hi)) message Hi;



Wich one is easier and wich one is most efficient?
Think about it.

??? you just brought a whole new topic =\

Dach 02-24-2004 06:48 AM

Quote:

Originally posted by osrs



NPC Code:

if(playersays(Hi)) message Hi;



NPC Code:

if(playerchats && strequals(#c,Hi)) message Hi;



Wich one is easier and wich one is most efficient?
Think about it.

Note: ganis are not neccesarily more efficient than sprite manipulation (even though it is now just setting the gani step of def.gani)

Loriel 02-24-2004 02:18 PM

Let this thread die.
It has went offtopic since the original poster does not seem to care anymore. You are free to restart your discussion in another thread if you really want.


All times are GMT +2. The time now is 03:40 PM.

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