RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[REQUEST] scripting tutorials (advanced)

0 Members and 1 Guest are viewing this topic.

**
Dupe account made by Blizzard =(
Rep:
Level 87
is there somewhere a tutorial for advanced scripting?
i only found basic tutorials everywhere
« Last Edit: March 28, 2007, 08:38:54 PM by Tsunokiette »
what!? ur not supposed to see this!

*
Rep:
Level 102
2014 Biggest Narcissist Award2014 Biggest Forum Potato2014 Best Non-RM Creator2013 Best Game Creator (Non-RM)2013 Best IRC ChatterboxParticipant - GIAW 112012 Most Successful Troll2012 Funniest Member2012 Best Use Of Avatar and Signature space2012 Best IRC ChatterboxSecret Santa 2012 ParticipantProject of the Month winner for November 2009For being a noted contributor to the RMRK Wiki2010 Most Successful Troll2010 Biggest Forum Couch Potato2010 Best IRC Chatterbox
You need to start with the basics and learn from them as the progress in difficulty.

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
Watch out for: HaloOfTheSun

*
A Random Custom Title
Rep:
Level 96
wah
Omg! I forgot about that XD I'm going to try to learn scripting :]

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
Omg! I forgot about that XD I'm going to try to learn scripting :]

darklord is no more teaching basic. so you would need to start higher. since this request was for advanced I thought the person wouldn't mind signing up for blizz.
Watch out for: HaloOfTheSun

*
A Random Custom Title
Rep:
Level 96
wah
Oh... Don't answer my question in the other thing.

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
I did I think..I posted this before you posted to apply. =D
Watch out for: HaloOfTheSun

*
A Random Custom Title
Rep:
Level 96
wah
Argh. The whole "when I posted, when you posted" is confusing me. And I can't seem to find any more basic tutorials. All the tutorials are more into teaching on making a CMS (and only that >_>) than really teaching lots about something or a little about everything. Plus, the thing on dublealex/creation asylum is never updated. WAHHHHH T_T XP

*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
I have written a tutorial about recursion, which probably is my most advanced scripting tutorial: http://z.crankeye.com/index.php?option=com_content&task=view&id=16&Itemid=29
It is one of the first I wrote, so it bears certain marks.

I haven't really written many scripting tuts, and besides whatever is posted at z.crankeye.com are the two tutorials I made for xLeD:

Spoiler for xLeD's 1st tutorial - Simple Sorting:
[size=15]Lesson 1[/size]
[size=10]Today's topic: Simple Sorting[/size]

Hey xLeD

First of I will start with a little something I have written about Arrays. Just skip what you know.
Then I will teach you the search algorithm Insertion-Sort.

Quote
[SIZE=8]Array[/SIZE]
Just skip the parts on theory you don't understand. I will not use pictures.

Theory
An array is a list of elements. A vector of elements is also correct. Just a different wording.
Let us assume that the elements are integers (whole numbers).
Try to think of a table with 1 column and a number of rows, let's say 10 rows.
In each cell is an integer. This integer is what is meant as an element. This is how the data is stored
There are 10 integers (elements) in all because there are 10 rows. This is an array with 10 elements.

Let's go back to the rows again and say we want 1 of the integers out from a certain cell.
We must have a way of finding the right cell. We have. It is called the index.
Think about us looking on the top row. Think that if you look at the bottom cell it will be farther away than the top cell. You can say that there is a distance between a certain cell and the top cell.
We can use this distance to get the cell we want. We could say that we wanted the cell with distance 5.
The top cell would of course have distance = 0 and the bottom cell would have the amount of elements - 1. Continuing the example the bottom cell would have distance = 9
Wow… amount of elements - 1... What does that mean?
Remember when we said that there were 10 rows? This is the amount of elements.  So we have 10 - 1 = 9.
If we now call distance for index you we have solved the question about what index means.

I hope it was understandable

Ruby
All the above might be very well, but it does not explain how to you it in ruby.
In Ruby everything is build of objects, which are created from classes. So naturally there is an Array-class.
Before going further I must point you to Ruby references on the Array-class
The above is just basically the syntax with comments.  Therefore you should read there instead of here.
Just a quick example though: (Same elements are allowed)
Code: [Select]
[6, 2, 4, 9, 2]   #<--- is an array
array = [6, 2, 4, 9, 2]   #<---- for before

# Getting the elements out
p array[0]  #---> 6
p array[4]  #---> 2
p array[5]  #---> nil

# A little trick
p array[-1] #---> 2
p array[-2] #---> 9

# -1 returns the last element in the array
# -2 returns the element before the last element and so on

I don't know what else there is to say as most of it is in the references.
Just ask if there is something you can't understand in the references.

References
Ruby references
Wikipedia.org

Insertion-Sort:
Let A be an array. The pseudo code for the algorithm is:
Code: [Select]
Insertion-Sort(A)
1  for j = 2 to length[A]
2      do key = A[j]
3          i = j - 1
4          while i > 0 and A[i] > key
5              do A[i + 1] = A[i]
6                    i = i - 1
7          A[i + 1] = key

Is it difficult to understand?
You should note that pseudo code isn't just pseudo code. This is my version of pseudo code.
Note that how much they are indented tells in which branch they are in.
For example is line 7 not in the while loop, but in the for-loop.
Line 6 is however in the for-loop.
And so on…

I know I haven't explained it well, and for that I apologize.
I have saved it for the tasks. You'll see ^_~

The tasks:
Reading is good, but alas reading alone is not as giving as tasks to follow up the read text.
Task 1:
A = [7, 12, 30, 12, 6, 29]
Put this array into the algorithm.
Calculate manually what A each time it is at the start of the for-loop.
Also calculate the output. (The sorted array).

Task 2:
Implement the algorithm into RMXP. Yup write it in Ruby.
Use the example from above to test.

Task 3:
Rewrite the algorithm so it sorts in decreasing order instead of increasing order.
In Ruby I mean.

Task 4: (optional)
Make the insertion sort as an extension to the Array class.
That is make a method insertion_sort that can be called like this:
Code: [Select]
[7, 12, 30, 12, 6, 29].insertion_sort
Good luck with the tasks.
 - Zeriab

Sources:
Recursion @ Wikipedia - http://en.wikipedia.org/wiki/Insertion_sort
Introduction to Algorithms - http://mitpress.mit.edu/algorithms/
My head - Sorry, no link to my head

I have attached the second one, which is in my opinion easier.


I don't really know how difficult the stuff I've made is, so sorry if it's too hard or too easy.

**
Dupe account made by Blizzard =(
Rep:
Level 87
You need to start with the basics and learn from them as the progress in difficulty.

no problem i know basic skripting already :P i can make scenes and cms.
i want to get better!
thx for everybody posting ill search more
what!? ur not supposed to see this!

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Hold your breath until I finish my scripting tutorial.
... maybe better don't... You might die until it's finished. :B

(BTW, it scripting with a c =P )
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

*
A Random Custom Title
Rep:
Level 96
wah
Lol. I noticed that too :P Anyways, OMFG!!! A scripting tut by Blizzard? :D Should we get our hopes up on having it finished before May? :P Also, what's it going to teach?

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Here's the contents list.

Quote
Contents:

1. Introduction
1.1. Why RAM or CPU?
2. Compatibility
2.1. Aliasing
2.2. Thinking in Advance
2.3. Names and Problems
2.4. “Stack level too deep”
2.5. RAM or CPU?
3. Data Processing and Storage
3.1. Why “looping”?
3.2. Why Methods/Functions?
3.3. How to handle Data efficiently
3.4. Module or Class?
3.5. RAM or CPU?
4. Windows
4.1. The Basics
4.2. The wrong Way to create a Window
4.3. Do they look nice?
4.4. Tricky Bitmaps
4.5. HUD Basics
4.6. The Problem with non-vital Information being displayed
4.7. RAM or CPU?
5. Decrease the Lag
5.1. Algorithm Complexity
5.2. What lags and why it lags (RGSS specific)
5.3. Decrease Process Time
5.4. Don’t fear more Code
5.5. On Screen
5.6. RAM or CPU?
6. Compact Code or just wannabe cool Scripting?
6.1. Scripts with {} brackets
6.2. One line functions
6.3. Inefficient RAM usage
6.4. Too much Code
6.5. Too many useless and pointless things
6.6. Too much SephirothSpawn
6.7. Avoid being an Idiot
6.8. Re-invent the Wheel
6.9. Enforcing Standards
6.10. Scripts the World doesn’t need
6.11. RAM or CPU?
7. Hints and Tricks
7.1. Train your Brain
7.2. First this or that?
7.3. The Trick with “unless”
7.4. Class Variable Access
7.5. Bug Hunter
7.6. Global, Local, Class Variable or Constants?
7.7. Superclass
7.8. Comments and Debug
7.9. RAM or CPU?
8. Useful Links
9. Summary

The red stuff needs to be done yet.
« Last Edit: March 31, 2007, 12:07:28 PM by Blizzard »
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
I love some of the section names.

Especially 5.4. Don’t fear more Code and 6.7. Avoid being an Idiot
I like sound of chapter 6 XD

@Blizz:
Just tell me if you want some help be it to proofread or whatever.
I got the writer's block with the tutorial I'm making, so doing something else might loosen it up ^_^

@Nexridia:
I guess you just have to do with what you can find of basic tutorials until Blizzard releases his.
Then again... As you know the basics you can try to search for some object-oriented programming tutorials. (Or OOP tutorial)

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
I think you will love the tute. ;8
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

**
Dupe account made by Blizzard =(
Rep:
Level 87
lol i will love it too! it sounds great! ok i will wait for your tut blizzard
what!? ur not supposed to see this!

**
Dupe account made by Blizzard =(
Rep:
Level 87
sorry for double post but have you finished something more on your tut blizzard?
what!? ur not supposed to see this!

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Erm, no... not yet... (-_-')
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!