ScriptObject, datablack, and where I meant to be going wrong.
by Keith Mc Dowell JR · in Torque Game Builder · 12/13/2007 (3:05 pm) · 2 replies
Hello, everyone
First question, where should datablock be place so when use TGB Editor to create gui you can make the assoication to the database? within the /common/datablock.cs file?
Second issue, I've written up a PlayerManager.cs file whch the plans are to handle most of the player's funcations. But, not having much like when attempting to assign a button to the function that should launch the window.. Gives an error messsage that either unable to find PlayerObject::UpdateView(%this,%PlayerRecord) or UpdateView("") same parameters..
new scriptObject(PlayerObjects)
{
class="PlayerObjectClasses";
};
In the same file of PlayerManager.cs I have
datablock simDataBlock(PlayersRecords)
{
PlayerName=""; hold player's name
};
I have function with commands like Add(); Delete(); Load(); UpdateView();, which I'm attempting to reference in the PlayerManager.cs as:
function PlayerObjects::UpdateView(%this,%PlayerRecords)
{
do something here
}
function PlayerObjects::Add(%this,%PlayerRecords)
{
do something here
}
I think I might have miss something, since well its not wanting to work the way I intended it to work. Also, QuestManager.cs would also follow the same style refering to items in the datablock of QuestManager.cs
Any insight, suggest would be most helpfull. COde??? samples would be awesome, since there is a some lack ok of well develop samples, and the Torque book is limited to (but has references to use with TGB) for TGE which I'm working with TGB at this time.
This working with data, numbers and text so I do not think it need s td2sceneObject, since most of this information is being push to players main window view.
Thanks,
First question, where should datablock be place so when use TGB Editor to create gui you can make the assoication to the database? within the /common/datablock.cs file?
Second issue, I've written up a PlayerManager.cs file whch the plans are to handle most of the player's funcations. But, not having much like when attempting to assign a button to the function that should launch the window.. Gives an error messsage that either unable to find PlayerObject::UpdateView(%this,%PlayerRecord) or UpdateView("") same parameters..
new scriptObject(PlayerObjects)
{
class="PlayerObjectClasses";
};
In the same file of PlayerManager.cs I have
datablock simDataBlock(PlayersRecords)
{
PlayerName=""; hold player's name
};
I have function with commands like Add(); Delete(); Load(); UpdateView();, which I'm attempting to reference in the PlayerManager.cs as:
function PlayerObjects::UpdateView(%this,%PlayerRecords)
{
do something here
}
function PlayerObjects::Add(%this,%PlayerRecords)
{
do something here
}
I think I might have miss something, since well its not wanting to work the way I intended it to work. Also, QuestManager.cs would also follow the same style refering to items in the datablock of QuestManager.cs
Any insight, suggest would be most helpfull. COde??? samples would be awesome, since there is a some lack ok of well develop samples, and the Torque book is limited to (but has references to use with TGB) for TGE which I'm working with TGB at this time.
This working with data, numbers and text so I do not think it need s td2sceneObject, since most of this information is being push to players main window view.
Thanks,
#2
Ok, now it makes sense on how they are defining namespaces and instances of Objects, either I misunderstood (pages 133-137) in Game Programmer's Guide.. Thanks again for that tid-bit of information.
12/14/2007 (7:35 am)
Hey, ChaimOk, now it makes sense on how they are defining namespaces and instances of Objects, either I misunderstood (pages 133-137) in Game Programmer's Guide.. Thanks again for that tid-bit of information.
Chaim Krause
Chaim Gang
{
class="PlayerObjectClasses";
};
In this case the name of the instance is "PlayerObjects" and the namespace is "PlayerObjectClasses" so you functions should use the namespace and not the instance name when you are defining them.
So it should be...
function PlayerObjectClasses::UpdateView()