Graal Forums

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

ForgottenLegacy 10-27-2003 03:48 AM

Suggested commands?
 
Anyone here who has suggestions on future commands, then let your ideas flow freely. I have some myself.

Commands:
NPC Code:

addweapon2 account,weapon;
removeweapon2 account,weapon;
removeweapon3 weaponindex;
setrotateeffect degrees; //Rotates the level npc
setrotateeffect2 degrees,centerx,centery; //Rotates the level npc
rotateimg index,degrees;
rotateimg2 index,derees,centerx,centery;
with (weapons[index]) {..}



I would like these to be added sometime. :\

DustyPorViva 10-27-2003 03:53 AM

The three weapon commands at the top can easily be achieved.

Python523 10-27-2003 04:13 AM

With the exception of the rotate commands, all of them are just reasons to promote laziness

ForgottenLegacy 10-27-2003 05:30 AM

The commands I'd really like are the rotateimg commands, thost would be awesome.

I know the way to do it, just use sine and cosine in a for loop, making each pixel of an image be it's own image. So far though, I have only gotten horizontal flips and vertical flips to work correctly... x.x

Python523 10-27-2003 05:32 AM

Quote:

Originally posted by ForgottenLegacy
The commands I'd really like are the rotateimg commands, thost would be awesome.

I know the way to do it, just use sine and cosine in a for loop, making each pixel of an image be it's own image. So far though, I have only gotten horizontal flips and vertical flips to work correctly... x.x

Why would you need sin and cos for a horizontal and verticle flip?

-Ramirez- 10-27-2003 06:09 AM

Quote:

Originally posted by ForgottenLegacy
The commands I'd really like are the rotateimg commands, thost would be awesome.

I know the way to do it, just use sine and cosine in a for loop, making each pixel of an image be it's own image. So far though, I have only gotten horizontal flips and vertical flips to work correctly... x.x

I've done experiments involving lots of showpolys, and they lag horribly, even on my PC. Doing it like that would be highly inefficient, although there currently IS no other way, but still.....

DarkShadows_Legend 10-27-2003 05:08 PM

I've thought of a few things, but most of them definitely promotes laziness.

NPC Code:

setheart var; // for setting the players full hearts number
drop(index,x,y,image); // dropping a weapon with the specified index and image at x,y coordinates
disablesword; // disables the sword from being used
isnotsparringzone; // opposite of issparringzone
indexofweapon(str); // to get the index of a weapon the player has
pctpart(min,max,var); // same as myvar = (min/max) * width
setprop str,text;
/* for working with message codes that involve editing the players look so we don't have to type out each one for each part, and instead use a string list and do other stuff. make sense? */
setview index; // similar to setfocus except it sets your view to the x,y coordinates of the player in the level with the index

setplayerspar type; // 0 = default rate 1 = win-loss record
some vars
playerlogtime // the amount of time the player has been on for the entire day
playersparwins // for type 1 sparring. gives the amount of wins the player has
playersparlosses // for type 1 sparring. gives the amount of losses the player has


ZeLpH_MyStiK 10-27-2003 09:04 PM

Even if most of your commands promote laziness, what is the point of isnotsparringzone? Why would you even want that? How is not putting in isnotsparringzone different from putting in nothing? Does this promote people to put in extra commands that arent needed?

osrs 10-27-2003 09:12 PM

A new flag to enablefeatures wich will disable the sword or disablesword as DarkShadows_Legend said.

DarkShadows_Legend 10-27-2003 11:08 PM

Quote:

Originally posted by ZeLpH_MyStiK
Even if most of your commands promote laziness, what is the point of isnotsparringzone? Why would you even want that? How is not putting in isnotsparringzone different from putting in nothing? Does this promote people to put in extra commands that arent needed?
To disable the level from being a spar area. For example lets say someone is laming and there is staff in there and they want to kill the spar straight away so nobody will lose rate.

Another thing is having a script that checks to see how many people are in the spar room. If there is say 3 people, 1 e.t. and 2 others and then a 4th person comes in to disrupt the spar then have a npc that disables the level from being a sparringzone.

osrs 10-27-2003 11:45 PM

Quote:

Originally posted by DarkShadows_Legend
Another thing is having a script that checks to see how many people are in the spar room.
#v(playerscount)..?

DIABLO2099 10-28-2003 12:36 AM

Quote:

Originally posted by osrs


#v(playerscount)..?

Maybe he means checking how many players are in a certain area of a level, but that can be currently achieved rather easily x.x.

Lance 10-28-2003 03:51 AM

Commands should not be created merely to promote scripter laziness.

osrs 10-28-2003 10:39 PM

Quote:

Originally posted by Lance
Commands should not be created merely to promote scripter laziness.
Most eficients commands are always better.

Lance 10-28-2003 10:55 PM

Quote:

Originally posted by osrs


Most eficients commands are always better.

Except, when efficiency is not the issue, but a command is requested merely to promote laziness (they do not want to code a simple effect for themselves, e.g. the 'players in spar area'), said requester should not be indulged.

DarkShadows_Legend 10-29-2003 03:12 PM

Quote:

Originally posted by osrs


#v(playerscount)..?

I was giving an example of what could be done with the other command. That is why both descriptions is in a paragraph so to give a basic explanation and example. :)

ForgottenLegacy 11-01-2003 04:35 AM

I have another idea:

Have the string commands that we take for granted (replacestring, insertstring, deletestring, removestring) be usable for arrays. Like, have a 'replacearray' command, or 'insertarray' or 'deletearray' etc...

Python523 11-01-2003 04:57 AM

Quote:

Originally posted by ForgottenLegacy
I have another idea:

Have the string commands that we take for granted (replacestring, insertstring, deletestring, removestring) be usable for arrays. Like, have a 'replacearray' command, or 'insertarray' or 'deletearray' etc...

in the new engine... and why would you need replacearray? oO var[index]=

ForgottenLegacy 11-18-2003 07:26 AM

Some commands that would be nice would be
NPC Code:

setplayercomments account,"comments";
message #s(getcomments(account));
message #s(getban(account));


This would be so we wold not have to give our GPs RC, so they can set the comments of a player via script, and resd them too.

DustyPorViva 11-18-2003 07:36 AM

I believe, since the new engine allows the RC to be scripted, that, along with ban and such, is all possible.

MrGannondorf 11-19-2003 01:07 AM

oo yes! scriptable rc interface!!!! thought I supose that makes my ingame-rc gui idea obsol33t.... oh well...

Anyhow, I don't think commands that 'support lazyness' are a bad thing, since it would make it alot faster to create stuff. Less to type sounds more like 'efficiency' to me, than 'lazyness'.

A command that would compleatly suport lazyness would be something like...

NPC Code:
putnpc player[index].idea;



Graal needs a mind reading variable.

Python523 11-19-2003 01:55 AM

Quote:

Originally posted by MrGannondorf
Less to type sounds more like 'efficiency' to me, than 'lazyness'.

Less doesn't mean more efficient

Lance 11-19-2003 02:30 AM

Quote:

Originally posted by MrGannondorf
Anyhow, I don't think commands that 'support lazyness' are a bad thing, since it would make it alot faster to create stuff. Less to type sounds more like 'efficiency' to me, than 'lazyness'.
Hi, you're not listening.

I could write a three-line script and an eighteen+ line script to do the same thing. The three-line script'd be preferable for conveniences's sake - it's not like it's any more efficient. If you want to make a complicated script into a single command, turn it into a function, and use it in your scripts. There's no sense in adding commands for simply-doable scripts, just because some scripters are too lazy to script it for themselves.

DarkShadows_Legend 11-19-2003 02:40 AM

Efficient Laziness. ;)

replacearray var?? X.x

I was thinking of something like
myvar = {0,1,2,3,4};
deletearrvar 2;
then have myvar = {0,1,3,4};
... buuuuuut there's another way to do this I think. I haven't tested it out yet though so I'm not completely sure.

Lance 11-19-2003 02:53 AM

Quote:

Originally posted by DarkShadows_Legend
Efficient Laziness. ;)

replacearray var?? X.x

I was thinking of something like
myvar = {0,1,2,3,4};
deletearrvar 2;
then have myvar = {0,1,3,4};
... buuuuuut there's another way to do this I think. I haven't tested it out yet though so I'm not completely sure.

It's not really advisable to use things that you don't understand in your scripts.

DarkShadows_Legend 11-19-2003 03:07 AM

There is a way to do that though isn't there?

Lance 11-19-2003 03:10 AM

Quote:

Originally posted by DarkShadows_Legend
There is a way to do that though isn't there?
Naturally. My best advice for any scripting problem is to think about just how such a command would work, and then script it.

MrGannondorf 11-19-2003 04:21 AM

o.o a lazy method. and its not to efficient on helping him get the command learned. oh, and fyi, thats sarcasm.

a command I'd like to see would be one to forcedownload files from remote servers.

forexample, lets say I have a cool mp3, thats just a *tad* to big to put on the ftp, or a pwa says we can't have it on the ftp, because graal doesn't want to be resposible for it being on thier ftp if it turns out to be copyrighted, or whatever reason you want that it would not be on the server's main ftp........

anyways, but its nice to have the file on the person's computer or in cache or something so it can be used.

so, one could script the npc to open a browser pointed at the url of the download... and hope that the player has the compitence to know where to put it, even after being told (wich most lack)...

or you could have it invisibly download behind the scenes, and come to the right place O.O

and if such a command does exist, then YATTA!

Lance 11-19-2003 04:31 AM

Quote:

Originally posted by MrGannondorf
o.o a lazy method. and its not to efficient on helping him get the command learned. oh, and fyi, thats sarcasm.

Making sense is rather underrated these days, isn't it? When scripters speak of efficiency, they speak of script efficiency - how stupid the wannabe-scripter is has nothing to do with it.

MrGannondorf 11-20-2003 01:59 AM

wow, scripters seem to have thier own solcial clicks, too.
just a small point you guys seem to neglect though...

Just because a potentual comand could make what would be a more complex script into a simple script, doesn't garentee that the command would be ineficient for the game to process, etc.

What you guys make it seem like, weather its your own thickheadedness or the inability to effectivly make a point, is that because there is a chance the new command in question could be taxing on the game, the command should be rule out of all consideration altogether.

Or are you afriad it would make your scripts seem mundane and have to think of new stuff?

I think the amount of content for the server you can make with one's methods should also be calculated somehow into what makes it efficient: not just how well it runs.

Python523 11-20-2003 02:16 AM

Quote:

Originally posted by MrGannondorf
wow, scripters seem to have thier own solcial clicks, too.
just a small point you guys seem to neglect though...

Just because a potentual comand could make what would be a more complex script into a simple script, doesn't garentee that the command would be ineficient for the game to process, etc.

What you guys make it seem like, weather its your own thickheadedness or the inability to effectivly make a point, is that because there is a chance the new command in question could be taxing on the game, the command should be rule out of all consideration altogether.

Or are you afriad it would make your scripts seem mundane and have to think of new stuff?

I think the amount of content for the server you can make with one's methods should also be calculated somehow into what makes it efficient: not just how well it runs.

Stop putting words into our mouths, then maybe you can propose a better arguement =/ we NEVER said that a scripted alternative is more efficient than a command all the time, I don't think we're the ones who have thick heads, stop trying to mock us when you are completely misunderstanding us and putting words into our mouths.

MrGannondorf 11-21-2003 06:40 AM

Oh sorry, it didn't sound like you and lance were listening.

Lets put this another way then.

Lets say Xnew command has been added, and is basicly a shortcut to making a gui ingame and can somehow be tuned to even generate its own unique graphics.

And it does it all with out using any processing time.


What it looks like to me, is you guys would be 100%, whole heartedly against it because it "Promotes Lazyness".

Now, my point is, that if a command can reduce the time it takes to script something, wouldn't that be worthy of the word "efficient" than "lazy"?

Lance 11-21-2003 06:53 AM

Quote:

Originally posted by MrGannondorf
Oh sorry, it didn't sound like you and lance were listening.

Lets put this another way then.

Lets say Xnew command has been added, and is basicly a shortcut to making a gui ingame and can somehow be tuned to even generate its own unique graphics.

And it does it all with out using any processing time.


What it looks like to me, is you guys would be 100%, whole heartedly against it because it "Promotes Lazyness".

Now, my point is, that if a command can reduce the time it takes to script something, wouldn't that be worthy of the word "efficient" than "lazy"?

You're still not getting it. When people want a new built-in command just so they can be lazy, I object. When people have a valid reason for a new command, I support it. It's that simple.

ForgottenLegacy 11-21-2003 07:37 AM

Quote:

Originally posted by Lance


You're still not getting it. When people want a new built-in command just so they can be lazy, I object. When people have a valid reason for a new command, I support it. It's that simple.

And, just in case you STILL do not understand, MrGannondorf, any command that can be done with the current level of GScript is a command that will promote lazyness. The shoot command, and the enablefeatures commands are not to promote lazyness, they are to enable a new ability not previously endowed to the scripters. However, commands like showtext, allthough necessary, were just added to promote lazyness. I hope you understand now. (Do not remove 'showtext'! I use it all the time!)

Lance 11-21-2003 07:48 AM

Quote:

Originally posted by ForgottenLegacy


And, just in case you STILL do not understand, MrGannondorf, any command that can be done with the current level of GScript is a command that will promote lazyness. The shoot command, and the enablefeatures commands are not to promote lazyness, they are to enable a new ability not previously endowed to the scripters. However, commands like showtext, allthough necessary, were just added to promote lazyness. I hope you understand now. (Do not remove 'showtext'! I use it all the time!)

Actually, shoot can be scripted. ;)

The enablefeatures command (self-explanatorially) enables certain features of the client, and disables others. This obviously cannot be rescripted (in the current way of doing things) because it directly affects the client.

MrGannondorf 11-21-2003 08:07 AM

ah, I guess how 'it promotes lazyness' said earlier on in the thread seemed rather blunt to deliver the point right.

"However, commands like showtext, allthough necessary, were just added to promote lazyness." Necessity, yes. Lazy? You can't realy call 'showtext' lazyness, because having text merged into showimg was lazy on its own. Showtext is by no means lazy in compairison to showimg showing text.

but I guess thats a ways besides the point.

ForgottenLegacy 11-25-2003 05:52 AM

Quote:

Originally posted by Lance
Actually, shoot can be scripted. ;)
Calling the actions and all? Nice. Allthough I have no idea how to get actionprojectile2 to work, is it serverside? Does it need to be in the same NPC that shot the projectile?

Riot 11-25-2003 06:37 AM

Quote:

Originally posted by ForgottenLegacy
Calling the actions and all? Nice. Allthough I have no idea how to get actionprojectile2 to work, is it serverside? Does it need to be in the same NPC that shot the projectile?
actionprojectile2 works serverside and clientside as far as I know.
It can be in any npc. It is called when the NPC lands.

#p(0) = x of landing
#p(1) = y of landing

Lance 11-25-2003 06:40 AM

Quote:

Originally posted by ForgottenLegacy


Calling the actions and all? Nice.

Indeed. In the projectile-destruction code, you'd make your own triggeractions.

ForgottenLegacy 11-25-2003 06:58 AM

I would like to see the code, Lance, so I can see how you guys do it. Is it the same code you used on the old Graal 2002 bows? Where you click and the arrow lands where you clicked?


All times are GMT +2. The time now is 07:57 AM.

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