Jump to content
  • 0

Scripting for Dummies


Z3R0

Question


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

* Request * Do Not Post These Links on eAthena.ws // Paradox has made it quite clear that he thinks we are attacking his server with a ddos attempts, and I feel the need to disperse from there entirely now.

Few Small Samples from eAthenaTutorials (Youtube Account Me and Any Other Video Developers Would Like to Host On)

I apologize if my voice sounds bad ( Allergies are kicking my ass )

NPC Scripting for Dummies (Audio / Video Tutorial)

Please Note, Everything is in Spoiler Tags to Prevent Super Page Stretching

The Curriculum:

Chapter 1: The Basics - Complete

Chapter 2: Variables - Complete

Chapter 3: Debugging - Complete

Chapter 4: Basic Menu System

Chapter 5: Math - Complete (Possibly Redo -- THANKS JGUY!!!!GRRRR)

Chapter 6: Logic

Chapter 7: Player Input

input

Chapter 8: Loops

goto loop

for

while

do while

Chapter 9: Arrays

Array Explanation

setarray

getarraysize

Array Functions (copyarray, delarray, cleararray)

Looping Through Array

Limitations (Variable Scoping)

Chapter 10: Advanced Menu System

select

prompt

Chapter 11: Functions

inline functions

global functions

Chapter 12: Events

OnInit

OnPCLogout

OnPCLogin

OnTouch

OnTimer####

OnClock####

List of Others

Chapter 13: NPC Attachment

attachrid

detachrid

getcharid

Chapter 14: Instances

create instance

working with instance variables

working with instance maps

Chapter 15: Further Reading

scripting documentation

iFoxKun's Text Follow Through of These Tutorials

Chapter 16: Final Touch

Working Quest NPC (3 NPC Quest Script)

Working Item Exchanger (1 NPC, Multiple Items)

Working Instance

Chapter 17: Custom - Requested Advice

N/A

Edited by Z3R0
Added Curriculum
  • Upvote 5
  • MVP 1
Link to comment
Share on other sites

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

I suggest : How to comment the code .

both way also can prevent the code from running..

This 1 we usually use when come to "Disable" multiple line

/* Part that Doesnt Run */

Just for 1 or several line usually.......

// Line that Doesnt Run

LOL i messed up with C Programming =='' ~

Edited by Emistry
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

O.o, since when did they allow block commenting?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  22
  • Reputation:   2
  • Joined:  11/16/11
  • Last Seen:  

To be sure . I'm looking to find the way to comment in 'src/map/script.c' . I think we can use block comment. ;)

const char* skip_space(const char* p)
{
if( p == NULL )
 return NULL;
for(;
{
 while( ISSPACE(*p) )
  ++p;
 if( *p == '/' && p[1] == '/' )
 {// line comment
  while(*p && *p!='n')
   ++p;
 }
 else if( *p == '/' && p[1] == '*' )
 {// block comment
  p += 2;
  for(;
  {
   if( *p == '0' )
 return p;//disp_error_message("script:skip_space: end of file while parsing block comment. expected "CL_BOLD"*/"CL_NORM, p);
   if( *p == '*' && p[1] == '/' )
   {// end of block comment
 p += 2;
 break;
   }
   ++p;
  }
 }
 else
  break;
}
return p;
}

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

Good to know actually... I did not know that was implemented...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  2244
  • Reputation:   182
  • Joined:  11/19/11
  • Last Seen:  

block comment like this:

/*

*/

I think you could always do that with the code. And yeah I already used it many times. It's very helpful.

Edited by Judas
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

Guess I will create a video on commenting considering I was not aware you could block...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

ya, ok I thought it was a recent addition... lol, been doing this for a while now, never knew about block commenting and no script I've ever seen used it

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   219
  • Joined:  11/22/11
  • Last Seen:  

really useful ;)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  217
  • Reputation:   18
  • Joined:  11/20/11
  • Last Seen:  

:) I was a generic simple scripter. This is SO helpful!!

*looks around* I control FIRE!!! o.o :3

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

I will do a few more tutorials tonight...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

iFoxKun something wrong with your upload?

( null )

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  38
  • Reputation:   7
  • Joined:  12/07/11
  • Last Seen:  

Cool !! With this more members will be able to learn scripting them self.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

That's the plan. I apologize for not being able to do anything lately... I am currently undergoing pc maintenance on my laptop ;)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  189
  • Reputation:   16
  • Joined:  11/20/11
  • Last Seen:  

iFoxKun something wrong with your upload?

( null )

Oh no I was using mobile, Ill send my upload right now~ I didn't have a signature in mobile that's why here~

Chapters 3, 4, 5~

scripting_tutorial3&4&5.txt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

Sorry there hasn't been much dev on this lately guys... my laptops been in shambles...I should be able to do more this weekend :D

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  1315
  • Reputation:   372
  • Joined:  12/10/11
  • Last Seen:  

I've been out of the RO scene/Scripting scene for a very long time and these videos are really helpful as a refresher. They're really easy to understand.

I'm hoping to see this whole thing through. Keep up the good work!

Couple of suggestions:

- mes command has been updated.

To display multiple lines of message while only using a single mes; command,
use the script command in the following format:

mes "Line 1", "Line 2", "Line 3";

This will display 3 different lines while only consuming a single line in
the relevant script file.

http://sourceforge.net/apps/trac/rathena/changeset/15072/

- I feel that changing the color of the text in game inside an NPC window should be covered as an extension of some sort to Chapter 1. It's something basic.

- Terms that could be defined as I'm assuming not everyone knows it

-- String

-- Integer

- I think you should speak up more if not just increase the gain on your microphone settings. I have to set the volume of my computer to the max in order to hear you clearly. =/

I'm considering replacing the basic scripting guide in the wiki with a transcripted version of this series.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

Ok, will definitely work on that, unfortunately, speaking louder is not an option, due to my 2 year old sleeping, however I will look into the increase of gain...

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   13
  • Joined:  12/09/11
  • Last Seen:  

Good work! /no1

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

Sorry guys, wasn't able to get any laptop time in this weekend... I apologize... I swear I'll have some more by the end of the week though /no1

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

LOL...Dont mind it...take your time...^^ All we have here....is TIME !! haha ~

still a long way to go...no need to push yourself so hardly...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  2244
  • Reputation:   182
  • Joined:  11/19/11
  • Last Seen:  

yep take your time!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  1
  • Reputation:   0
  • Joined:  01/06/12
  • Last Seen:  

Wow thank you for posting this. I have been wanting to learn more about scripting so I can be more useful Quite the comprehensive guide! ... and videos! You're awesome, Z3R0!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  318
  • Reputation:   68
  • Joined:  11/13/11
  • Last Seen:  

It's great in the first place that you are dedicating some time to make and post these videos. You've been a great support for several of the members here =D!

You don't have to rush such projects. In fact, for these kinds of videos, you have to take time ;D and explain clearly to avoid any confusion.

You are doing great <3!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  01/14/12
  • Last Seen:  

the first variable tutorial doesn't work for me. when follow the tutorial only the temporary variables settings work

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  1315
  • Reputation:   372
  • Joined:  12/10/11
  • Last Seen:  

How are you doing it? I've gone through what's available so far and didn't find any problems on the way Z3R0 explained things.

  • Upvote 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...