About Store Forum Documentation Contact



Post Reply 
Sun and static objects problem.
Author Message
menajev Offline
Member

Post: #1
Sun and static objects problem.
1. Sun is caputt - even in tutorials sun gives no light (i checked "Suns" tutorial). When camera is moving some light appears (when zooming it affects whole map, but when just rotating it looks like lightpoint in random place).
I haven't updated engine for a while and that is since I updated it yesterday (but meanwhile i had some pc problems and i changed GPU drivers so I can't be sure that it's update fall.

2. This don't work since i updated engine today (or yesterday evening, in any case - it was working when sun brokes down) : user - defined object types are not loaded.
Code:
struct Static : public Game::Static
{
    virtual void create(Game::ObjParams &obj);  //<--- this is not performed
};
I haven't change rest of code. I checked 3 times libs and all is fine.
01-25-2010 05:47 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Sun and static objects problem.
1 ill check it

2. If think you have the object in embed into terrain, change it to const/default
01-25-2010 05:55 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Sun and static objects problem.
1. it works fine for me
01-25-2010 05:56 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #4
RE: Sun and static objects problem.
(01-25-2010 05:55 PM)Esenthel Wrote:  2. If think you have the object in embed into terrain, change it to const/default
No, i tried to change to embed into terrain and then objects shows on map (but as a terrain element, not my object), but when it's default nothing happen.
@1: I think i have to change GPU drivers.
01-25-2010 06:00 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Sun and static objects problem.
yes, if you have it put into "embed into terrain" then you can't use custom class because object will be managed fully by the engine (its in the docs)
01-25-2010 06:12 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #6
RE: Sun and static objects problem.
You misunderstood me - if I put into "embed into terrain" objects are on map. But when i change to default - they aren't there and static::create is not performed even once (LogN at start).
01-25-2010 06:51 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: Sun and static objects problem.
did you use Game::World.objSetType as in tutorials?
01-25-2010 07:19 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #8
RE: Sun and static objects problem.
Yep:
Code:
Game::ObjMemx<Static> Statics; //global
Game::World.setObjType(Statics,OBJ_STATIC); // in Init()
01-25-2010 07:37 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #9
RE: Sun and static objects problem.
Did you rebuild your world after changing object types to OBJ_STATIC and DEFAULT access mode?
01-25-2010 07:41 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #10
RE: Sun and static objects problem.
Yes, I'm sure that in loading code and in maps all is ok. Something another must be broken, but I have no idea what - in version history I can't see anything, which should I update.
http://www.menajev.yoyo.pl/mtgal/0.png - this is loading succesful,
http://www.menajev.yoyo.pl/mtgal/1.png - this is not loaded.
I checked "doors" tutorial - all ok, but when i tried to load this my with my code objects don't load.
I checked linker settings and it's same as tutorial.
01-26-2010 11:31 AM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #11
RE: Sun and static objects problem.
Solved - i performed Game::World.init(); before every map loading - removing this line makes all work corectly.
01-26-2010 02:58 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #12
RE: Sun and static objects problem.
after 'init', 'setObjType' must be called
01-26-2010 04:25 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #13
RE: Sun and static objects problem.
It's quite strange, because I didn't change this code section since long time, but it's not important now.
About sun - it's definitely my pc fault - on another same programs run without any problems.
01-26-2010 08:43 PM
Find all posts by this user Quote this message in a reply
Post Reply