learngs2:helloworld

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
learngs2:helloworld [2022/06/09 02:20] twinnylearngs2:helloworld [2023/02/24 12:12] (current) twinny
Line 1: Line 1:
-<-  learngs2 learngs2:variables ->+<< start start whatjusthappened >
 + 
 +====== Hello World ======
  
 Whenever you learn a new language, the first step is often to perform what is known as a "Hello World": it's a simple script that just prints out that statement but it confirms your environment has been set up. We can use this to test that your RC access has been setup and you know what to go. Whenever you learn a new language, the first step is often to perform what is known as a "Hello World": it's a simple script that just prints out that statement but it confirms your environment has been set up. We can use this to test that your RC access has been setup and you know what to go.
  
-The code looks like this. Don't worry if you don't understand what any of these lines mean right nowwe will come back to that!+The code looks like this:
  
 <code javascript> <code javascript>
 function onCreated() { function onCreated() {
-  echo("Hello, world!");+  echo("Hello, World!");
 } }
 +
 +
 </code> </code>
 +
 +Don't worry if none if this makes sense right now: we will dive into all aspects as we go. For now, we can under stand that the moment this NPC is created, it will print "Hello, world!" somewhere. Let's make it happen!
 +
 +First, we will hit the 'Weapons' button in RC: {{:learngs2:rc_weaponlist_normal.png?nolink&32x32}}
 +
 +This will open a list of all the current Weapons in the server. For Testbed, this will be a lot.
 +
 +//{{:learngs2:learning_helloworld_weapons.png?nolink&546x494}}//
 +
 +From here, we want to press the 'Add' button down the bottom. This will open a prompt where we can enter the name for our weapon. If you are using the Testbed server, you will need to follow the standard naming convention. For me, this would be Personal/Twinny/HelloWorld . You would replace 'Twinny' with your account name. If you are unsure, open your rights and check what rights you have been given [TODO: prob add dedicated section]
 +
 +{{:learngs2:learning_helloworld.png?nolink&322x143}}
 +
 +When you hit OK, it will open a new window where you can create your weapon but it hasn't done so yet. It will only do so when you hit Apply. For now, enter the code as provided above:
 +
 +{{:learngs2:learning_helloworld_code.png?nolink&812x376}}
 +
 +Hit Apply and hopefully you will successfully create your first script and see the output in RC!
 +
 +{{:learngs2:learning_helloworld_success.png?nolink&855x62}}
 +
 +You've made your first successful script…hopefully! If you didn't see 'Hello, world!' you may have seen an error instead. Some examples:
 +
 +<code>
 +Twinny prob: No write rights for WEAPONS/Personal/NotMe/HelloWorld
 +
 +</code>
 +
 +This is telling me I don't actually have rights to create a weapon with this name. If you see something like this, you will need to check your rights to confirm what weapons you can create (if any). [TODO: elaborate]
 +
 +If you have been successful, we can move on! Let's go!
 +
 +
  • learngs2/helloworld.1654741240.txt.gz
  • Last modified: 2022/06/09 02:20
  • by twinny