Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

View Poll Results: Is this a good idea?
Yes 33 100.00%
No 0 0%
Voters: 33. You may not vote on this poll

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-06-2006, 07:31 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Interactive Lessons

I've started to make GS2 lessons which will could become available on servers in the form of interactive GUI's which display information, give questions/feedback as well as practical lessons. It's just an idea i've had and I'd like to know if it is actually a decent idea before i sit down and map out a few lessons. below is my first basic lesson on objects (Information may be slightly incorrect but i'm sure Skyld will kick me if i give wrong information).

Lesson Base
PHP Code:
/* Lesson 1 : Objects */
//#CLIENTSIDE
function onWeaponFired()
  
showLesson();

public function 
showLesson()
{
  new 
GuiWindowCtrl("Lesson1Window")
  {
    
profile       "GuiBlueWindowProfile";
    
extent        "450 300";
    
position      "5 5";
    
text          "Lesson 1 : Learn About Objects. By Twinny";
    
destroyonhide true;
    
canmaximize   false;
    
canresize     false;
  
    new 
GuiTextCtrl("Lesson1Title")
    {
      
profile "GuiBlueTextProfile";
      
position "30 25";
      
profile.fontsize 40;
      
text "Brief Lesson on Objects!";
    }
    
    new 
GuiScrollCtrl("Lesson1Scroll") {
      
profile       "GuiBlueScrollProfile";
      
position      "15 75";
      
extent        "420 200";
      
hscrollbar "dynamic";
      
vscrollbar "dynamic";
      
visible    true;
      
canmove    true;
    
      new 
GuiMLTextCtrl("Lesson1Body") {
        
useownprofile true;
        
profile       "GuiBlueScrollProfile";
        
position      "5 5";
        
extent        "400 180";
     }
    }
      
  }
  
graalControl.addControl(Lesson1Window);
  
setLesson();

Actual lesson
PHP Code:
function setLesson()
{
  
Lesson1Body.settext(
  
"Welcome to Twinny's basic lesson about objects!" NL
  
"Graal is made up of objects. Some examples include players, levels,
  weapons, horses, bombs and gui controls." 
NL "" NL
  
  
"An object is made up of variables, functions and other objects.
  Let's take a look at a few variables, objects and functions found in a level." 
NL "" NL
  
  
"Some Functions" NL
  
"function objecttype()" NL
  
"function findareanpcs()" NL
  
"function getmappartfile()" NL
  
"function tiletype()" NL "" NL
  
  
"Some Objects" NL
  
"arrows = TGraalVar;" NL
  
"bombs = TGraalVar;" NL
  
"chests = TGraalVar;" NL
  
"compus = TGraalVar;" NL
  
"horses = TGraalVar;" NL "" NL
  
  
"Some Variables" NL
  
"isnopkzone = 0;" NL
  
"issparringzone = 0;" NL
  
"name = graalcitybank_inside_01.nw;" NL
  
"nopkzone = 0;" NL
  
"tilelayercount = 1;" NL
  
"tiles = 0;" NL
  
"timeout = 0;" NL
  
"width = 64;" NL "" NL

  
"The function used to make that will become available in lesson 2
  GS2 allows for intereaction with objects. For example:
  player.chat = level.name;. This will make the player say the levels name" 
NL "" NL
  
  
"You can also access custom functions using objects. Eg. player.customfunction();" NL
  
"You can also access the object itself using this eg. this.x = 40" NL "" NL
  
  
"This is just a brief example of what will no doubt become alot more clearer.
  Hopefully this wasn't too hard to understand. If not - mail me at [email protected]
NL
  
"Next lesson: Advanced Objects with a few practical based lessons"
);    

Very basic with no interactive material. Do not judge / vote on that exact lesson but moreso on the idea of interactive lessons

[Edit]: You may notice i made showlesson(); a public function. I intend to link all these weapons together to form a much more interactive lesson scheme.
Reply With Quote
 


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 10:28 PM.


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