GuiObjectView And setting a MountedObjects Skin using Bace.name
by AllynMcelrath · in Torque Game Engine · 09/24/2006 (3:11 pm) · 10 replies
Using The GuiObjectView.......
I have a player shape loaded into the GuiObjectView.
An object is set in it using:
and i have an image mounted to that using:
Now all this works great.
Now, i want to change just the texture the mounted object uses.
I try:
But...it cant find the object.
So , i know im doing this wrong, and im sure its something simple...it just stumping me right now and i cant figure it out with my limited scripting knowledge.
So if anyone can help me out with this. Its will be greatly appreciated.
Editing.
I have a player shape loaded into the GuiObjectView.
new GuiObjectView(NewPlayerObjectView) {
Profile = "GuiDefaultProfile";
HorizSizing = "relative";
VertSizing = "relative";
Position = "32 32";
Extent = "304 440";
MinExtent = "8 2";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
tooltip = "Right Click And Drag to Rotate Player";
applyFilterToChildren = "1";
cameraZRot = "0";
forceFOV = "40";
};An object is set in it using:
NewPlayerObjectView.setObject("player_Female", "./starter.fps/data/player/Female/Female.dts", "", 0);
NewPlayerObjectView.mountObject("Hair_01","./starter.fps/data/Player/Female/Female_Hair/Hair_01.dts","",$Current_NewPlayerObjectViewName,mount0,0); // Mount the Hair
NewPlayerObjectView.loadDSQ("player_Female", "./starter.fps/data/player/Female/Female_root.dsq"); // Load up the root sequence
NewPlayerObjectView.setSequence("player_Female", "Root", 1); // Set the sequence to Rootand i have an image mounted to that using:
NewPlayerObjectView.mountObject("Hair_01",$Hair_01_Path,"",$Current_NewPlayerObjectViewName,mount0,0);Now all this works great.
Now, i want to change just the texture the mounted object uses.
I try:
NewPlayerObjectView.player_Female.Hair_01.setSkinName("brown");But...it cant find the object.
So , i know im doing this wrong, and im sure its something simple...it just stumping me right now and i cant figure it out with my limited scripting knowledge.
So if anyone can help me out with this. Its will be greatly appreciated.
Editing.
#2
I am mounting the "Hair_01" to the "$Current_NewPlayerObjectViewName" witch happens to be in this example "player_Female".
If it was male the "$Current_NewPlayerObjectViewName = player_male;".
I'm using globals to keep track of what is currently loaded in the GUIobject. So i don't have to hardcode it...and because im not the best scripter in the world...but reading my script is easy to do because it Chunked into logical parts...at least ..for me. and someone who doesn't know allot about scripting...like me. I also use very logical (if not long) Function names and var names.
Eather way, im still having this problem and have not been able to figure it out...
Basicly, i just need to know how one would drill threw to the hair_01 object to changes it texture using the Bace.Name.jpg setup for objects.
As with all my scripts, im sure there is a better way to do anything i create..but hay.. im just an artist.
Thanks for the reply.
09/25/2006 (9:31 am)
Yeah, you are, sorry. I am mounting the "Hair_01" to the "$Current_NewPlayerObjectViewName" witch happens to be in this example "player_Female".
If it was male the "$Current_NewPlayerObjectViewName = player_male;".
I'm using globals to keep track of what is currently loaded in the GUIobject. So i don't have to hardcode it...and because im not the best scripter in the world...but reading my script is easy to do because it Chunked into logical parts...at least ..for me. and someone who doesn't know allot about scripting...like me. I also use very logical (if not long) Function names and var names.
Eather way, im still having this problem and have not been able to figure it out...
Basicly, i just need to know how one would drill threw to the hair_01 object to changes it texture using the Bace.Name.jpg setup for objects.
As with all my scripts, im sure there is a better way to do anything i create..but hay.. im just an artist.
Thanks for the reply.
#4
Edit: bah, you're using mounted objects not images, ignore my comment. Though the issue could still be related to how the object is referenced.
09/25/2006 (2:54 pm)
I don't think you can reference the displayed object like this NewPlayerObjectView.player_Female. But that's not the main issue, mounted 'images' aren't really objects, they're datablocks, so I don't think you can change the skin for mounted objects.Edit: bah, you're using mounted objects not images, ignore my comment. Though the issue could still be related to how the object is referenced.
#5
"It seems as if that object you mounted it not really there, as if it's only a referenced file, so trying to treat it as an object will do nothing".
You can test this self (please do and post back). The object in the view is apparently not an object...so any of its properties that you think would, do not work, you can't even get its name out of the GUI if you ask for it.
I'm thinking this is a limitation of the control. The only way to get around this is to mount another hair_01 to it, using the "skin" parameter that is different.
If it was an object, then my NewPlayerObjectView.player_Female.Hair_01.setSkinName("brown"); (Grandparent.Parent.Child.Thingtodo(%stuff);) would have worked.
Going to be hell for me to script... I was hoping for everyone's sanity that I could just change the texture.
@ john yeah, in the engine that shape is an image... in the GUI control its an object.
Any more help would be greatly appreciated
Side note: I still can't find anything on getting a light in there, or changing the distance the camera is from the object. I really think this GUI control needs a huge update and Documentation. Everyone wants it, and its very useful. I tried looking at the synapse gaming site, but it seems the document that was there is gone, and there is nothing about it in the TLK documents, thou I have run across may posts about there being a TLK implementation of it..... John?
09/26/2006 (1:11 pm)
Trying to list the items turns up nothing at all. I had a friend that is much smarter than i look at this (computer scientist that works at my company). He said"It seems as if that object you mounted it not really there, as if it's only a referenced file, so trying to treat it as an object will do nothing".
You can test this self (please do and post back). The object in the view is apparently not an object...so any of its properties that you think would, do not work, you can't even get its name out of the GUI if you ask for it.
I'm thinking this is a limitation of the control. The only way to get around this is to mount another hair_01 to it, using the "skin" parameter that is different.
If it was an object, then my NewPlayerObjectView.player_Female.Hair_01.setSkinName("brown"); (Grandparent.Parent.Child.Thingtodo(%stuff);) would have worked.
Going to be hell for me to script... I was hoping for everyone's sanity that I could just change the texture.
@ john yeah, in the engine that shape is an image... in the GUI control its an object.
Any more help would be greatly appreciated
Side note: I still can't find anything on getting a light in there, or changing the distance the camera is from the object. I really think this GUI control needs a huge update and Documentation. Everyone wants it, and its very useful. I tried looking at the synapse gaming site, but it seems the document that was there is gone, and there is nothing about it in the TLK documents, thou I have run across may posts about there being a TLK implementation of it..... John?
#6
GuiObjectView Update: Lighting Support
Looking at the code, for some reason a lot of the DTS code was reimplemented (there is probably a really good reason), but it means you'll need to duplicate any features in the standard DTS library and shape base derived objects that you need.
Cam distance is controlled with the mouse and lighting using the above resource (support sunlight only).
09/26/2006 (1:45 pm)
There is an updated resource that modifies the original to add sunlight, env mapping, and some other things:GuiObjectView Update: Lighting Support
Looking at the code, for some reason a lot of the DTS code was reimplemented (there is probably a really good reason), but it means you'll need to duplicate any features in the standard DTS library and shape base derived objects that you need.
Cam distance is controlled with the mouse and lighting using the above resource (support sunlight only).
#7
I don't do C++ =(
Referring to light and cam. I have never seen a command to add a light to any of the GUIobjectViews. I was under the impression that you could set the initial lighting and direction. As for the Cam, User control is fine, im referring to setting on creation the distance the camera is from the object mounted, the current is fine unless you are using NON-ORC standard sizes for the models. There must be a way to set the Cameras distance when you create or, set an object into the control from script.
Thank you for your response.
09/26/2006 (1:52 pm)
Yes, i have seen that one (i think its the one im using). But i cant find any documents on it. (Script commands, How to set the sunlight and properties, Examples ETC..)I don't do C++ =(
Referring to light and cam. I have never seen a command to add a light to any of the GUIobjectViews. I was under the impression that you could set the initial lighting and direction. As for the Cam, User control is fine, im referring to setting on creation the distance the camera is from the object mounted, the current is fine unless you are using NON-ORC standard sizes for the models. There must be a way to set the Cameras distance when you create or, set an object into the control from script.
Thank you for your response.
#8
Changing the cam position would need to be done in C++ to add the script controls (they currently don't exist).
09/26/2006 (1:58 pm)
It only supports sunlight, which uses lightDirection, lightColor and ambientColor.Changing the cam position would need to be done in C++ to add the script controls (they currently don't exist).
#9
Bummer about the camera. And the DTS rewrite. Seems this control just isn't up to the task for a player selection and creation screen. (at least as detailed and with the number of options I had).
I guess ill have to go with my plan B.. and use a small 3d canvas. Bummer. I had made allot of progress too... (everything but the texture swapping, and it seems I would never have gotten the Hide mesh for the parts the need to deform working at all.....)
I still would like to see full documentation on this with some example scripts, i guess i can Wright another TDN if i can cobble together from the various resources all the methods and get some questions answered.
09/27/2006 (8:48 am)
Thank you for your help, where would I find these fields? Is it something i need to add in the dynamic fields for the control? Should they already be there?Bummer about the camera. And the DTS rewrite. Seems this control just isn't up to the task for a player selection and creation screen. (at least as detailed and with the number of options I had).
I guess ill have to go with my plan B.. and use a small 3d canvas. Bummer. I had made allot of progress too... (everything but the texture swapping, and it seems I would never have gotten the Hide mesh for the parts the need to deform working at all.....)
I still would like to see full documentation on this with some example scripts, i guess i can Wright another TDN if i can cobble together from the various resources all the methods and get some questions answered.
#10
10/20/2006 (10:39 am)
Still looking for more info on this controal.
Torque Owner J "hplus" W