Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   How do I start? (https://forums.graalonline.com/forums/showthread.php?t=44806)

Androk 05-08-2003 11:38 PM

How do I start?
 
What is the best way for me to start on GScripting? Right now I am able to script some basic stuff, but I keep getting blocked off on simplest things, and on very hard things.

Perfect Example would be this line that nobody who I asked could fix:

NPC Code:

if (timeout) {
showimg 4,hl_menu.png,60,screenheight-20;
changeimgpart 4,60,20,int((200/strtofloat(#s(client.maxhp)))*strtofloat(#s(client .curhp))),20;
changeimgvis 4,4;

timeout = .05;
}



What is strange is that if value of client.curhp is below or above client.maxhp then the bar is very screwd up.

Anyway, what is the best way for me to improove my skills?

Muha_builder 05-09-2003 11:05 AM

there is only one way the same im doing right now think of a script you want to make start making it and try to find ppl that want to help you trough the process and ofcourse you got to like scripting.and about that script let me test

CheeToS2 05-09-2003 01:04 PM

Just take it one step at a time, learn at your own pace.. sometimes it will get to trial and error when you're trying to learn how to use something correctly, but make sure you understand it when you find the solution that works :P

If you get stuck and you have absolutely no clue how to fix it, or you have a clue but don't know how to implement it, then go ask a guru :p

A lot of people have trouble understanding it because they're not in the right mindset for it.. you have to think logically, not magically. Learn to read it like a second language (which you could already be doing by now), and it will be much easier.

<insert something else here I forgot>

Androk 05-09-2003 02:22 PM

Quote:

Originally posted by CheeToS2

A lot of people have trouble understanding it because they're not in the right mindset for it.. you have to think logically, not magically. Learn to read it like a second language (which you could already be doing by now), and it will be much easier.

I already read it like a language =)

Thanks for comments everyone. All of you have valid points, I'll take them all into account =)

Kaimetsu, I really think that you should try your best at solving the problem, until you know you just can't do it (for example 3 weeks of trying to write a line is too much...).

Androk 05-09-2003 04:17 PM

Quote:

Originally posted by Kaimetsu

Learning to script should not be a team activity, it should be one person trying to reach a personal understanding of an abstract system. Sure, if they're not sure how a particular command works then it's fine to ask, but those are just the building blocks. The person should figure out how to put those blocks together on his or her own.

My understand of that is that Person should solve all problems on his own, without any help.

Quote:

Originally posted by Androk
Kaimetsu, I really think that you should try your best at solving the problem, until you know you just can't do it (for example 3 weeks of trying to write a line is too much...).
While this message to my understanding means that you should try to solve the problem on your own, until you know that you can't, then you should ask someone.

Quote:

Originally posted by Kaimetsu

Why are you addressing this to me, Androk? It doesn't run contrary to my statements.

It does, and yet it doesn't. It is more of an addition to your statement, and yet it somewhat changes the whole meaning.

I think that should make sense now... Sorry if it didn't before =)

Tseng 05-09-2003 04:31 PM

Quote:

Originally posted by Kaimetsu
NO

Learning to script should not be a team activity, it should be one person trying to reach a personal understanding of an abstract system. Sure, if they're not sure how a particular command works then it's fine to ask, but those are just the building blocks. The person should figure out how to put those blocks together on his or her own.

I agree with this. If other people do everything for you, how are you expected to learn? The simplest and best way is to figure it out for yourself, and, as Kaimetsu said, if you don't understand how a certain command works, ask someone who does. :)

Dach 05-09-2003 08:24 PM

If only we still had the old level pack so new scriptors could easily have access to decent scripts without worry of stealing...

*slides something across table*
something

Androk 05-09-2003 09:02 PM

Quote:

Originally posted by Dach
If only we still had the old level pack so new scriptors could easily have access to decent scripts without worry of stealing...

*slides something across table*
something

Zip is broken, and I have Old Classic level pack. But it doesn't help any, since it's so old -.-

osrs 05-09-2003 11:51 PM

I dont know if i'm the right person to say this,but if you want to learn and be a good scripter,do not stole other people script,you will never learn by that way,i know that because i had a good experience about this,but now I'm getting a good scripter (at least i think) because i'm scripting everything by myself and i want to be a good scripter,so i work hard for that..=]

screen_name 05-10-2003 07:11 AM

NPC Code:

if (created || timeout) {

if (strtofloat(#s(client.curhp))>strtofloat(#s(client .maxhp))) setstring client.curhp,#v(strtofloat(#s(client.maxhp)));

showimg 4,houses_main3.png,60,screenheight-20;
changeimgpart 4,60,20,int((200/strtofloat(#s(client.maxhp)))*strtofloat(#s(client .curhp))),20;
changeimgvis 4,4;

timeout = 2;
}



I'm not sure what you mean by all screwed up, but I copied your and just changed the image name and it worked perfectly. I read about it getting screwed up when it's above, so look up ^.

Androk 05-10-2003 04:56 PM

I fixed the script =) Also all the changing of variables to strings is not needed, it works fine without all that. In fact it works even better.

All that I had to do was changeimgvis to 5 as opposed to 4, but you couldn't really know that because I didn't provide you with the whole script =). You see I had 2 Images have exactly same coordinates, as well as be on the same layer, but now that the one that overlays in ob higher level it works perfectly...


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

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