About Store Forum Documentation Contact
Donations:
225$/mo



Post Reply 
[RESOLVED] Directly reading a .obj from file
Author Message
aceio76 Offline
Silver Supporter

Post: #1
[RESOLVED] Directly reading a .obj from file
Simply doing the following is not working:
Code:
Game::ObjParamsPtr obj="Obj/Weapon/Common/Leather.obj";
Int total=0; if(Param *p=obj->findParam("Total")) total=p->asInt();

What are my requirements before I can read an .obj file like above? Any pointers? The .obj is not placed in the world through the world editor, but I'd like to read its params directly.

www.thinkplaystudios.com
(This post was last modified: 10-09-2011 10:53 PM by aceio76.)
10-09-2011 12:59 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #2
RE: Directly reading a .obj from file
Code's fine. Is the parameter Total actually saved to the .obj file? My guess would be no.
10-09-2011 06:20 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #3
RE: Directly reading a .obj from file
Yes it is in the .obj file through the World Editor.

Currently my guess is that the obj is not in the cache (CacheElmPtr<ObjParams, ObjParams::_Objs>)

www.thinkplaystudios.com
(This post was last modified: 10-09-2011 06:24 AM by aceio76.)
10-09-2011 06:22 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #4
RE: Directly reading a .obj from file
What happens when the code is ran?
10-09-2011 06:24 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #5
RE: Directly reading a .obj from file
It doesn't see any of params in the obj file. Again, this obj is not placed in the game world itself, but its params are set through the world editor by editing the object properties navigating directly to the obj file location.
I did forget to mention this is being done on the server side. The client can do this, as expected, since it loads the game world.

www.thinkplaystudios.com
(This post was last modified: 10-09-2011 06:30 AM by aceio76.)
10-09-2011 06:27 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #6
RE: Directly reading a .obj from file
Did you save the .obj file again after adding the parameter? If you just add the parameter, but don't overwrite the .obj, it won't work obviously.

It doesn't have to be added to the world for it to work.

Might have something to do with it being on the server side.
10-09-2011 06:35 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #7
RE: Directly reading a .obj from file
Yea, I do think something else needs to be done to get the obj be in the objparams cache, and I can't find any documentation that talks of it.

I can confirm the params are there through the client. But I need to read them on the server side.

www.thinkplaystudios.com
(This post was last modified: 10-09-2011 06:41 AM by aceio76.)
10-09-2011 06:41 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #8
RE: Directly reading a .obj from file
Your code works for me (loading a different .obj file, of course). I'm not even loading a world so that has nothing to do with it.

The very first line is all that it takes to add it to the ObjParams cache.

Sounds like this has something to do with the server (since it's working on the client). Esenthel will likely have more insight. I guess we will have to wait and see! pfft
10-09-2011 06:57 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #9
RE: Directly reading a .obj from file
EE, do you have anything that can help us with this?

www.thinkplaystudios.com
10-09-2011 07:08 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #10
RE: Directly reading a .obj from file
things to look:
1. Game::Objs.mode
2. ObjParams::sortParams
3. wrongly uploaded .obj file to the server
4. wrong .obj file loaded
10-09-2011 07:10 PM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #11
RE: Directly reading a .obj from file
(10-09-2011 07:10 PM)Esenthel Wrote:  things to look:
1. Game::Objs.mode

Thanks, this allowed me to move forward.

www.thinkplaystudios.com
10-09-2011 10:53 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply