Index · Preferences · Help
Teka Co Announcements · Teka Co. General · Teka Co. Contests · Teka Co Rankings · Teka Co. Tutorials
Forum Search:

[Advanced Search]

[Messages in this Thread] [Return to Teka Co. Tutorials]

Author:Kingmasherr (Consigliere) [Moderator] [Posts]
Date:9/13/09 4:36 pm [Last edited: 9/13/09 4:57 pm]
Topic:Version 1.3 : Procs and How to Use Them
Post ID:173
Alright, in this tutorial I will teach you what Procs are and how exactly you use them! It's not all that hard but it can get complicated sometimes. So lets get started!!

mob/proc/Basic()

Inside a Proc be sure to always include a '()' after it otherwise you will receive errors when you compile.

I started off with a simple name for it, 'Basic'.

mob/proc/Basic()//Previous Code
    switch(input("Example Text, Continue?") in list ("Yes","No","Maybe..?")
        if("Yes")
            usr << "Alright, lets continue!"
            return
        if("No")
            usr << "Oh, thats unfortunate to hear.."
            return
        if("Maybe..?")
            usr << "Well then tell me when you decide!"
            return

Okay, now I guess it's really time to explain! First off where it says 'Example Text, Continue?' that's what text would pop up to the player when the proc is used. A box will appear with that text on top and it will have a list of choices.

Return is case sensitive, it does what it says returning the character back to his screen also exiting out of the box.

mob/proc/Basic()
    switch(input("Example Text, Continue?") in list ("Yes","No","Maybe..?")
        if("Yes")
            usr << "Alright, lets continue!"
            
        if("No")
            usr << "Oh, thats unfortunate to hear.."
            return
        if("Maybe..?")
            usr << "Well then tell me when you decide!"
            return //Previous Code

mob/Login//Just like in the other Tutorial..
    usr << alert ("Welcome to the basic Game!")
    src.Basic()

Time to explain once more!! The mob/Login was used in the previous Tutorials. So you should understand that! The src.Basic() part is easy to explain. Like before I told you what usr and src means. For Example. Im usr and your src. If I wanted to attack you It would say "[usr] attacked [src]." which would be "[I] attacked [you]." Really easy!

Lastly, I will explain with the alert part means in usr << It will alert the player with a rectangular small box with that text leaving a choice saying "OK".

Well there you have it. Kingmasherr has done it again creating yet another tutorial. Be sure to check out the next tutorial, 1.4 Variables and Stat Panels! {Coming Soon}

Messages in this Thread:

  Version 1.3 : Procs and How to Use Them Kingmasherr (9/13/09 4:36 pm)