Game Development Community

TGB moveMap vs ActionMap (partialy solved)

by Jeffrey Gonzalez · in Torque Developer Network · 08/03/2009 (6:53 am) · 2 replies

Background (in nutshell): I recently figure out that a 2d world is more suited to my project then a 3d world. to keep it smaller and simpler. So I downloaded Torque Game Builder(TGB).

Question:Where can I find the difference between an ActionMap and a moveMap?

I figured out from the documentation that a moveMap is an ActionMap. I also figure out from Tutorial how to use a moveMap.

moveMap.bindObj(keyboard, "A", "moveUp", %this);
vs.
testActionMap.bind(keyboard, "u", toggleU);

moveMap uses bindObj method while actionMap uses bind. seems with the functions are called the Parms are differnt. both have %val that will be a 1 if the key is pressed or a 0 if the key is not pressed.

on fishControlsBehavior::moveUp(%this, %val)
<-- from the mini Behavior tutorial
vs.
function toggleU(%val)
<-- TGB Documentation

This is the info I have been able to deduce. What I would love is a like to moveMap and it definition. If the only info is in the code, no biggie I can go through that as well. Just point me in the general direction and I will find it

Thanks

Jeff

#1
08/03/2009 (9:46 am)
**Update ** I found this on the forums http://www.garagegames.com/community/resources/view/9779

it states that there is a client/default.bind.cs. I do not seem to have a file named that. However the post show the code from it

moveMap.delete();   
new ActionMap(moveMap);

This tells me that moveMap is an actionMap. Now I just have to figure out why moveMap usung bindObj instead of just bind.

A searching I go.
#2
08/03/2009 (5:41 pm)
Ok further research using agent ransack I discovered that my in TGB I do not have a client/default.bind.cs. I found most of what I was looking for in either the game.cs, main.cd and a common.cs this seems to have the default tilde as well as the creation of moveMap

I still do not understand how I am suppose to know that when I use .bindObj I need to create a function with (%this, %val) and when I use .bind my function would have (%val).

Well back to searching the Documents for a clue.