Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-08-2003, 11:38 PM
Androk Androk is offline
Registered User
Androk's Avatar
Join Date: Apr 2003
Posts: 614
Androk is on a distinguished road
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?
__________________

Name: Androk
Reply With Quote
  #2  
Old 05-09-2003, 11:05 AM
Muha_builder Muha_builder is offline
Registered User
Muha_builder's Avatar
Join Date: Jan 2003
Posts: 246
Muha_builder is on a distinguished road
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
Reply With Quote
  #3  
Old 05-09-2003, 01:04 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
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

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>
__________________

Reply With Quote
  #4  
Old 05-09-2003, 02:22 PM
Androk Androk is offline
Registered User
Androk's Avatar
Join Date: Apr 2003
Posts: 614
Androk is on a distinguished road
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...).
__________________

Name: Androk

Last edited by Androk; 05-10-2003 at 04:00 AM..
Reply With Quote
  #5  
Old 05-09-2003, 04:17 PM
Androk Androk is offline
Registered User
Androk's Avatar
Join Date: Apr 2003
Posts: 614
Androk is on a distinguished road
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 =)
__________________

Name: Androk

Last edited by Androk; 05-10-2003 at 04:00 AM..
Reply With Quote
  #6  
Old 05-09-2003, 04:31 PM
Tseng Tseng is offline
Sublime
Tseng's Avatar
Join Date: Jan 2003
Location: California
Posts: 0
Tseng is on a distinguished road
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.
__________________
Funny Things:
Quote:
Originally posted by Stefan
I didn't ban you, I only played a little bit with my RC.
-----
Reply With Quote
  #7  
Old 05-09-2003, 08:24 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
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
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #8  
Old 05-09-2003, 09:02 PM
Androk Androk is offline
Registered User
Androk's Avatar
Join Date: Apr 2003
Posts: 614
Androk is on a distinguished road
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 -.-
__________________

Name: Androk
Reply With Quote
  #9  
Old 05-09-2003, 11:51 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
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..=]
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #10  
Old 05-10-2003, 07:11 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
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 ^.
__________________
[signature]insert here[/signature]
Reply With Quote
  #11  
Old 05-10-2003, 04:56 PM
Androk Androk is offline
Registered User
Androk's Avatar
Join Date: Apr 2003
Posts: 614
Androk is on a distinguished road
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...
__________________

Name: Androk
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:23 PM.


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