• 0
Sign in to follow this  
charlielovesu

Need some pointing in the right direction, help please =(

Question

So I've been googling and searching the forums for ages, but as a person with basically zero background in scripting/coding, I really have no idea where I should be beginning. A tip I was given was to get a server running locally (have done that) and start trying to give myself small tasks like creating an NPC. The problems I've come across is that more often than not there isn't really a clear guide or step by step process on how to do something. Or worse, guides will say "do this" and the the thing they suggest just doesn't exist for what I'm trying to do or have.  Right now I'm kind of overwhelmed and don't know where I should begin as there is a lot of different things I can do and directions I can take. I'm more than willing to put in a lot of time and teach myself by reading, but I really do not know where to begin to start learning. I'm not looking to put up a Ragnarok server immediately, I just want to learn the fundamentals first. 

For information I followed the offline Rathena pack from 2018 in this guide to get a server running on my own pc. 
 

Its working just fine for me and I can functionally mess around with it in game, but now I want to get into the actual learning and editing. Adding stuff in, removing, changing, etc. I want to know how all that works and where I should start. What are the recommended starter projects? What should I be focusing on first? Any information is greatly appreciated. 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I would suggest that you get more knowledge about scripting. 
Here is a basic guide about scripting: Click me!
and here are the docs, there you can find documentation about every script command: Click me, i am cooler!

But here comes the problem, the basic guide and also probably most guides just teach you the syntax but not „How to code“.
Most languages have the typical things like „if“, „for-loop“, „while-loop“ and „functions“ and you have to learn how all that works.
If you already know a programming language then you probably know about all these things and learn to write rA-scripts is just about learning the syntax.
My suggestion would be to try to acutal learn a programming language (via youtube tutorial or whatever) to get a basic understanding of how coding works and then go and learn rA-scripting syntax.

When I started I didn‘t have clue either. Lucky me, I learned some Java at school. With my basic knowledge of the typical things I took a NPC and tried to understand how it works and later change it, that way I learned more and more about the syntax of rA-Scripts but most of the knowledge I got until now is from learning programming „concepts“ in school & university. 

Hoped this helped a least a little.

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Normynator said:

I would suggest that you get more knowledge about scripting. 
Here is a basic guide about scripting: Click me!
and here are the docs, there you can find documentation about every script command: Click me, i am cooler!

But here comes the problem, the basic guide and also probably most guides just teach you the syntax but not „How to code“.
Most languages have the typical things like „if“, „for-loop“, „while-loop“ and „functions“ and you have to learn how all that works.
If you already know a programming language then you probably know about all these things and learn to write rA-scripts is just about learning the syntax.
My suggestion would be to try to acutal learn a programming language (via youtube tutorial or whatever) to get a basic understanding of how coding works and then go and learn rA-scripting syntax.

When I started I didn‘t have clue either. Lucky me, I learned some Java at school. With my basic knowledge of the typical things I took a NPC and tried to understand how it works and later change it, that way I learned more and more about the syntax of rA-Scripts but most of the knowledge I got until now is from learning programming „concepts“ in school & university. 

Hoped this helped a least a little.

every attempt out there to help me get started is appreciated, so I appreciate the advice. I guess I will start by learning basic scripting first. probably C++ I'm guessing? is that a good script to start with? 

Share this post


Link to post
Share on other sites
  • 0

Well it's not "scripting" i think, its acutal programming. As a beginner language I really liked Java, you can go with C++ but is maybe a bit though for a beginner.

Share this post


Link to post
Share on other sites
  • 0

Point in the right direction:

  1. Open doc/script_commands.txt and read it from start to the end, each command, and what it doing.
  2. Download sublime text or VSCode and read how to use different shortcuts, always use one of these editors while you work with NPC script code. Always set C syntax highlight. It will help you hell a lot of times. That why it is very important to know different shortcuts like removing a line, duplicate line, select several lines at once, etc. Without a good editor, you will fail or will be very restricted.
  3. Create your own server what you will offer for players to play, prepare features what you wish to create, and start to do it 1 by 1, via copypasting it from script releasing and editing for your own needs, but please read what it is doing and what you change
  4. Now open doc/atcommands.txt and read available commands for you, most used commands are: @reloadscript, @reloadnpc, @unloadnpc, @loadnpc, @refresh, @go 0
  5. Create a custom folder in npc/myfolder for example, and create custom scripts_myscripts.conf and put all your custom scripts what will be automatically loaded to the server
  6. Tune, edit, write your own code.
  7. With time you will be more and more bounded to script_commands for reading what do each command, and what you need to use to create your own type of scripts.

Script learning I can divide by next parts:

  1. You MUST read from the first line to the last line whole script_commands.txt, this is MUST HAVE thing, without it you will not be able to write anything.
  2. Read around 5 chapters in Kernighan and Ritchie C programming language before pointers, arrays, and other complicated stuff.
    Just to understand syntax, if, while, do, for, vars. Nothing more.
  3. At first step, you should understand how to use simple vars, arrays, loops, and how to go through array elements for editing data inside or accessing it
  4. Then you need to understand how to use dynamic NPC menus (from arrays) to creating dynamic NPC's scripts. Just use an example what is provided by many scripts writes on the board
  5. Then start to play with timers, OnClock labels, OnTime labels, etc.
  6. Then write just scripts with goto at the first time, and later start to use more advanced if/else/switch.
  7. Do not try to write your code perfect from the start, just try to write it to make it just works, this is super important to know about scripting, do not even try to optimize something, or write in "super-duper true way", do not listen anyone and do not try to copy-paste someone style of code writing, try your own, try to do your own mistakes, and errors.
  8. Then after a few months or more,  you will be enough (if you will try to create your own scripts) to write own versions of scripts released in a script session.
  9. That it.
  10. Than start learn C (if you wish to go deeper)

 

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this