Page 1 of 2

What are you all talking about? I'm extremely confused...

Posted: April 19th, 2011, 10:32 am
by BrutalStatus
I've been using this application for about a month now and I have no clue how to do anything.
I can hit F2 and F3 and drop things in my map, also I can add different textures, but other than that I've got no clue what to do. I posted a forum much like this before, but I didn't get the help I need and i'm becoming very impatient...
First off, I don't know where to put "script" like

//command
alias myalias [1]

//infix variant
myalias = [1]

or how to make "triggers" or even what triggers are. People have linked me wiki sites, but they explain in vocabulary that I'm unfamiliar with so I just get more confused and frustrated. I don't intend this to be a sob story or a long one, so I'm going to end it here.
Please someone help!

Re: What are you all talking about? I'm extremely confused..

Posted: April 19th, 2011, 8:10 pm
by arcones
Well first of all, it's rather unfair that you'd give an example like:

Code: Select all

//command
alias myalias [1]

//infix variant
myalias = [1]
Because, to be honest, I don't use it. Start with the basics.

Well, let's say you place down a pie. You really REALLY want to pick that pie up. When you first place it in edit mode there is a small box beneath the mapmodel. Looking at the box you should see several things, but at the moment lets focus on two things:
Trigger Type
Level_Trigger #

Trigger Type
Trigger types tell the engine which animation/sound/etc to run for the mapmodel. When the trigger type is 12, the pie would be picked up, disappearing from the ground in the process. Heres the entire list of trigger types and their functions: Sandbox Mapping/Command Editing Reference

Level Trigger
Level trigger's are associated with coding. When I have a code that begins with level trigger 1, whatever comes after that (inside the brackets of course) responds solely to level trigger one.

Code: Select all

    "level_trigger_1" = "showgui Friend"
    newgui "Friend" [ <---Bracket
       guitext "Hi I'm your friend!" chat
       guitext "Want to talk?" chat
       guibutton "Sure!" "showgui Friend_1"
       guibutton "No. (close)" "cleargui"
       ]<--- Bracket
Now, if it was supposed to respond to picking up a pie, I'd set the Trigger Type on the pie to 12, but set my level_trigger to whatever the code was for either chatting about the pie, adding the pie to an inventory, etc.

Here's an example from the shop script:

Code: Select all

"on_start" = [ <----------Part one
   money = 0
   pie = 0
   sword = 0
   treasure = 0
   ]

"level_trigger_1" = [ money = ( + $money 5 ) <----------Part two 
   echo "You got 5 moneys."
   ]

"level_trigger_2" = "showgui Shopkeeper" <----------Part three

newgui Shopkeeper [ <---------- continuation of Part three
   guitext "What're ya buyin, stranger?" chat
   guibar
   guilist [
      guibutton "Pie: 10 moneys" [
         if ( > $money 9 ) [
            money = ( - $money 10 )
            pie = ( + $pie 1 )
         ]
      ]
      guibar
      guibutton "Sword: 20 moneys" [
         if ( > $money 19 ) [
            money = ( - $money 20 )
            sword = ( + $sword 1 )
            ]
         ]
      guibar
      guibutton "Treasure: 40 moneys" [
         if ( > $money 39 ) [
            money = ( - $money 40 )
            treasure = ( + $treasure 1 )
            ]
         ]
   ]
]

newgui Inventory [ <----------Part four
guibutton "Back" "cleargui 1"
guibar
guitext ( format "You have %1 moneys in your wallet." $money )
guitext ( format "You have %1 pies.  Yum." $pie )
guitext ( format "You have %1 swords.  Not that you can use them..." $sword )
guitext ( format "You have %1 treasures.  Lucky you!" $treasure )
]

newgui main [
   guilist [
      guilist [
         guibutton "Inventory" "showgui Inventory"
      ]
   ]
   guibar
   @main
]
Part One
It looks like a lot, and it is. But I'll break it down.

Code: Select all

"on_start" = [
   money = 0
   pie = 0
   sword = 0
   treasure = 0
   ]
This bit of code shows what you own when you start. At the moment, you own nothing.

Part Two

Code: Select all

"level_trigger_1" = [ money = ( + $money 5 ) 
   echo "You got 5 moneys."
   ]
This level trigger will be associated with ANY mapmodel with the level trigger 1. Note that it's not relating to any trigger type, but the level trigger. This bit of code basically says that money (A.K.A. whatever mapmodel you have set up for this) equals five moneys. Once you pick up the mapmodel (lets use a coin) it'll say "You got 5 moneys."

Part Three

Code: Select all

"level_trigger_2" = "showgui Shopkeeper"

newgui Shopkeeper [
   guitext "What're ya buyin, stranger?" chat
   guibar
   guilist [
      guibutton "Pie: 10 moneys" [
         if ( > $money 9 ) [
            money = ( - $money 10 )
            pie = ( + $pie 1 )
         ]
      ]
      guibar
      guibutton "Sword: 20 moneys" [
         if ( > $money 19 ) [
            money = ( - $money 20 )
            sword = ( + $sword 1 )
            ]
         ]
      guibar
      guibutton "Treasure: 40 moneys" [
         if ( > $money 39 ) [
            money = ( - $money 40 )
            treasure = ( + $treasure 1 )
            ]
         ]
   ]
]
This code tells any mapmodel with the level trigger of 2 to show a dialogue window, therefore it's best to use a person/elf/ogre etc. Showgui "shopkeeper" is a basic code which tells the engine that what will follow is newgui "shopkeeper". This will bring up a new dialogue window (it's important to note that this is all to bring up the dialogue window for "What are ya buyin, stranger?")

The function "guilist" is the GUI command for bringing up a list (the buttons which allow you to buy items.) The bracket [ following the guilist means that anything that follows it inside the ] (the close bracket) is part of that list.

Code: Select all

guibutton "Pie: 10 moneys" [
         if ( > $money 9 ) [
            money = ( - $money 10 )
            pie = ( + $pie 1 )
         ]
      ]
The GUI command guibutton creates a button has multiple abilities. In this case, it's to buy a pie This basically says: if you have more than 9 moneys, you can buy a pie for 10 moneys( if ( > $money 9 ) ). Now what comes in between the next two brackets. When you buy the pie, you will lose 10 moneys, but you will gain a pie. Experimentation for these type of values does help.

Each guibutton after the guilist is essentially the same, except that they have different values.

Part Four

Code: Select all

newgui Inventory [ 
guibutton "Back" "cleargui 1"
guibar
guitext ( format "You have %1 moneys in your wallet." $money )
guitext ( format "You have %1 pies.  Yum." $pie )
guitext ( format "You have %1 swords.  Not that you can use them..." $sword )
guitext ( format "You have %1 treasures.  Lucky you!" $treasure )
]

newgui main [
   guilist [
      guilist [
         guibutton "Inventory" "showgui Inventory"
      ]
   ]
   guibar
   @main
]
I believe the first 3 lines are rather easy to understand, so I'll move onto the guitext.

This guitext is a format for showing numbers with each item (the items expressed with the "on_start" command).
Each line of text tells what percentage of 100 it has. So lets say you picked up 5 coins, it would show 5 coins in the inventory.
Showing the $money at the end means the engine knows what item has 5 coins. It's the same with each item. If there's any confusion please let me know! I want to make this as clear as possible
Arcones

Re: What are you all talking about? I'm extremely confused..

Posted: April 21st, 2011, 11:48 pm
by BrutalStatus
Thanks a ton! I just have one major question...
Where do i put this code?? or what do I do with it to make it work??

Re: What are you all talking about? I'm extremely confused..

Posted: April 22nd, 2011, 8:39 am
by arcones
In your map .cfg file. Any map you have will most likely have an .ogz file, and an art-cfg file. Open a new notepad file and enter the code in (copy and paste) and save as mapname.cfg

Then enter the game and try it out!

Re: What are you all talking about? I'm extremely confused..

Posted: April 22nd, 2011, 4:00 pm
by Runescapedj
arcones wrote:Well first of all, it's rather unfair that you'd give an example like:

Code: Select all

//command
alias myalias [1]

//infix variant
myalias = [1]
Because, to be honest, I don't use it. Start with the basics.

Well, let's say you place down a pie. You really REALLY want to pick that pie up. When you first place it in edit mode there is a small box beneath the mapmodel. Looking at the box you should see several things, but at the moment lets focus on two things:
Trigger Type
Level_Trigger #

Trigger Type
Trigger types tell the engine which animation/sound/etc to run for the mapmodel. When the trigger type is 12, the pie would be picked up, disappearing from the ground in the process. Heres the entire list of trigger types and their functions: Sandbox Mapping/Command Editing Reference

Level Trigger
Level trigger's are associated with coding. When I have a code that begins with level trigger 1, whatever comes after that (inside the brackets of course) responds solely to level trigger one.

Code: Select all

    "level_trigger_1" = "showgui Friend"
    newgui "Friend" [ <---Bracket
       guitext "Hi I'm your friend!" chat
       guitext "Want to talk?" chat
       guibutton "Sure!" "showgui Friend_1"
       guibutton "No. (close)" "cleargui"
       ]<--- Bracket
Now, if it was supposed to respond to picking up a pie, I'd set the Trigger Type on the pie to 12, but set my level_trigger to whatever the code was for either chatting about the pie, adding the pie to an inventory, etc.

Here's an example from the shop script:

Code: Select all

"on_start" = [ <----------Part one
   money = 0
   pie = 0
   sword = 0
   treasure = 0
   ]

"level_trigger_1" = [ money = ( + $money 5 ) <----------Part two 
   echo "You got 5 moneys."
   ]

"level_trigger_2" = "showgui Shopkeeper" <----------Part three

newgui Shopkeeper [ <---------- continuation of Part three
   guitext "What're ya buyin, stranger?" chat
   guibar
   guilist [
      guibutton "Pie: 10 moneys" [
         if ( > $money 9 ) [
            money = ( - $money 10 )
            pie = ( + $pie 1 )
         ]
      ]
      guibar
      guibutton "Sword: 20 moneys" [
         if ( > $money 19 ) [
            money = ( - $money 20 )
            sword = ( + $sword 1 )
            ]
         ]
      guibar
      guibutton "Treasure: 40 moneys" [
         if ( > $money 39 ) [
            money = ( - $money 40 )
            treasure = ( + $treasure 1 )
            ]
         ]
   ]
]

newgui Inventory [ <----------Part four
guibutton "Back" "cleargui 1"
guibar
guitext ( format "You have %1 moneys in your wallet." $money )
guitext ( format "You have %1 pies.  Yum." $pie )
guitext ( format "You have %1 swords.  Not that you can use them..." $sword )
guitext ( format "You have %1 treasures.  Lucky you!" $treasure )
]

newgui main [
   guilist [
      guilist [
         guibutton "Inventory" "showgui Inventory"
      ]
   ]
   guibar
   @main
]
Part One
It looks like a lot, and it is. But I'll break it down.

Code: Select all

"on_start" = [
   money = 0
   pie = 0
   sword = 0
   treasure = 0
   ]
This bit of code shows what you own when you start. At the moment, you own nothing.

Part Two

Code: Select all

"level_trigger_1" = [ money = ( + $money 5 ) 
   echo "You got 5 moneys."
   ]
This level trigger will be associated with ANY mapmodel with the level trigger 1. Note that it's not relating to any trigger type, but the level trigger. This bit of code basically says that money (A.K.A. whatever mapmodel you have set up for this) equals five moneys. Once you pick up the mapmodel (lets use a coin) it'll say "You got 5 moneys."

Part Three

Code: Select all

"level_trigger_2" = "showgui Shopkeeper"

newgui Shopkeeper [
   guitext "What're ya buyin, stranger?" chat
   guibar
   guilist [
      guibutton "Pie: 10 moneys" [
         if ( > $money 9 ) [
            money = ( - $money 10 )
            pie = ( + $pie 1 )
         ]
      ]
      guibar
      guibutton "Sword: 20 moneys" [
         if ( > $money 19 ) [
            money = ( - $money 20 )
            sword = ( + $sword 1 )
            ]
         ]
      guibar
      guibutton "Treasure: 40 moneys" [
         if ( > $money 39 ) [
            money = ( - $money 40 )
            treasure = ( + $treasure 1 )
            ]
         ]
   ]
]
This code tells any mapmodel with the level trigger of 2 to show a dialogue window, therefore it's best to use a person/elf/ogre etc. Showgui "shopkeeper" is a basic code which tells the engine that what will follow is newgui "shopkeeper". This will bring up a new dialogue window (it's important to note that this is all to bring up the dialogue window for "What are ya buyin, stranger?")

The function "guilist" is the GUI command for bringing up a list (the buttons which allow you to buy items.) The bracket [ following the guilist means that anything that follows it inside the ] (the close bracket) is part of that list.

Code: Select all

guibutton "Pie: 10 moneys" [
         if ( > $money 9 ) [
            money = ( - $money 10 )
            pie = ( + $pie 1 )
         ]
      ]
The GUI command guibutton creates a button has multiple abilities. In this case, it's to buy a pie This basically says: if you have more than 9 moneys, you can buy a pie for 10 moneys( if ( > $money 9 ) ). Now what comes in between the next two brackets. When you buy the pie, you will lose 10 moneys, but you will gain a pie. Experimentation for these type of values does help.

Each guibutton after the guilist is essentially the same, except that they have different values.

Part Four

Code: Select all

newgui Inventory [ 
guibutton "Back" "cleargui 1"
guibar
guitext ( format "You have %1 moneys in your wallet." $money )
guitext ( format "You have %1 pies.  Yum." $pie )
guitext ( format "You have %1 swords.  Not that you can use them..." $sword )
guitext ( format "You have %1 treasures.  Lucky you!" $treasure )
]

newgui main [
   guilist [
      guilist [
         guibutton "Inventory" "showgui Inventory"
      ]
   ]
   guibar
   @main
]
I believe the first 3 lines are rather easy to understand, so I'll move onto the guitext.

This guitext is a format for showing numbers with each item (the items expressed with the "on_start" command).
Each line of text tells what percentage of 100 it has. So lets say you picked up 5 coins, it would show 5 coins in the inventory.
Showing the $money at the end means the engine knows what item has 5 coins. It's the same with each item. If there's any confusion please let me know! I want to make this as clear as possible
Arcones
You should ad this to the wiki, Arc

Re: What are you all talking about? I'm extremely confused..

Posted: April 22nd, 2011, 4:17 pm
by arcones
I don't have the time, or inclination, but it's a good idea.

Re: What are you all talking about? I'm extremely confused..

Posted: April 23rd, 2011, 8:11 am
by Runescapedj
You have the time to write it all, but not the few mins to copy and paste it onto the wiki?

Re: What are you all talking about? I'm extremely confused..

Posted: April 28th, 2011, 7:23 am
by RpgAprz
I do not understand this ...

as I do if I put an ogre ... on the map ...

and I put all this on f6, but in the end

the ogre and the script is not attached,

not have the link ...

I hope I made ​​you understand ..

how do I talk to the ogre?

Re: What are you all talking about? I'm extremely confused..

Posted: April 28th, 2011, 8:48 am
by arcones
Runescapedj wrote:You have the time to write it all, but not the few mins to copy and paste it onto the wiki?
I copied it from a PM I sent someone. It took a while.
RpgAprz wrote:I do not understand this ...

as I do if I put an ogre ... on the map ...

and I put all this on f6, but in the end

the ogre and the script is not attached,

not have the link ...

I hope I made ​​you understand ..

how do I talk to the ogre?
I understand, but this is for FPS mode, not RPG. You could try it in FPS mode for getting the ogre to talk (the ogre must be on level_trigger = 1 (or whatever number that you need, just make sure the code has the same level trigger)).

Arcones

Re: What are you all talking about? I'm extremely confused..

Posted: April 28th, 2011, 9:48 am
by RpgAprz
"level_trigger_1" = "Showgui Friend"
newgui Friend [ <--- Bracket
guitext "HOla yo soy tu amigo !! " chat
guitext "Que bien !! " chat
] <--- Bracket


I have an error in this code?

it does not work?

ogre and place the tag and trigger level = 1 ...

inclusive place instead of "showgui friend" ogre ....

I'm in fps ... single player and I get the box to "speak"

any ideas?

thanks for your time ...

Excuse the boldness but why not make a video tutorial for this topic

there are many novice users who do not know these things ... because it clarified

questions ...