Mud-H Posted January 13, 2016 Share Posted January 13, 2016 I gave a try to the free DoorClass from http://www.richardsgamestudio.com/ and I couldn't get it to work. I tried to debug it and I notice that the Door::advanceThreads(F32 dt) function is not called and it contain important code to deal with the opened/closed state. I tried different things but got no success to get the advanceThreads call. I have been able to make it work by using the onSequenceEnd callback and hidding the ColMeshes with the script but I'd prefer to use the code..Anyone have an idea about what's is happening? Something have changed in this area recently?The parent ShapeBase::advanceThreads(F32 dt) get called, shouldn't the Door function be called before since it's a child? The function is public and from previous experience, it should be called...right? :oops: I think the code setup is made so that only the Door::advanceThreads(F32 dt) get called, what you think is missing?You can grab the DoorClass files from there: http://www.richardsgamestudio.com/downloadDoorPack.html Quote Link to comment Share on other sites More sharing options...
RichardM Posted January 28, 2016 Share Posted January 28, 2016 Sorry for the late response, but I was occupied with other things. I will take a look at it. Quote Link to comment Share on other sites More sharing options...
SqHd Posted January 29, 2016 Share Posted January 29, 2016 Great! It would be awesome having this in the current version! Thanks! Quote Link to comment Share on other sites More sharing options...
paulmm123 Posted February 12, 2016 Share Posted February 12, 2016 Add it to door class on file doors.cpp:void Door::advanceTime(F32 dt){ advanceThreads(dt);}Now will be called, but still not working...after advanceTime change, isGhost() ways true and mShapeInstance->getTriggerState not get some index... Quote Link to comment Share on other sites More sharing options...
paulmm123 Posted February 16, 2016 Share Posted February 16, 2016 I'm not sure, there is a small bug in Door::packUpdate and Door::unpackUpdate that dont update door property islocked on editorThe commented lines make work... U32 Door::packUpdate(NetConnection *connection, U32 mask, BitStream *stream) { Con::errorf(ConsoleLogEntry::General, "Door::packUpdate"); U32 retMask = Parent::packUpdate(connection, mask, stream); stream->writeFlag(mBlockCheckEnable); //if (stream->writeFlag(mask & OpenMask))<--------if enabled, dont update door property islocked on editor stream->writeFlag(mIsOpen); //if (stream->writeFlag(mask & LockMask))<--------if enabled, dont update door property islocked on editor stream->writeFlag(mIsLocked); if (stream->writeFlag(key)) stream->writeRangedU32(key->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast); //...rest of code } why only stream->writeFlag(mask & LockMask) dont work however only stream->writeFlag(mIsLocked); work ? :?: void Door::unpackUpdate(NetConnection *connection, BitStream *stream) { Con::errorf(ConsoleLogEntry::General, "Door::unpackUpdate"); Parent::unpackUpdate(connection, stream); mBlockCheckEnable = stream->readFlag(); Con::errorf(ConsoleLogEntry::General, "mBlockCheckEnable %d",mBlockCheckEnable); //if (stream->readFlag()) <-------if enabled, dont update door property islocked on editor { mIsOpen = stream->readFlag(); Con::errorf(ConsoleLogEntry::General, "mIsOpen %d",mIsOpen); } //if (stream->readFlag()) <--------if enabled, dont update door property islocked on editor { mIsLocked = stream->readFlag(); Con::errorf(ConsoleLogEntry::General, "mIsLocked %d",mIsLocked); } //...rest of code } if I am not mistaken, both BitStream::writeFlag() and BitStream::readFlag() foward the bit mask from bitNum , if i call two times subsequently I would not take the wrong bit ?Thanks for any help! Quote Link to comment Share on other sites More sharing options...
paulmm123 Posted February 16, 2016 Share Posted February 16, 2016 I can conclude that for boolean types, is not necessary pre check of bits as :if (stream->writeFlag(mask & bitMask)) stream->writeFlag(mMyBool );So instead I write and read directly the boolean...pack:stream->writeFlag(mMyBool );unpack:mMyBool = stream->readFlag();This is what I've seen in others codes as player.cpp ... Quote Link to comment Share on other sites More sharing options...
paulmm123 Posted February 17, 2016 Share Posted February 17, 2016 is working perfectly, i tested both client and server with sounds too. I tried to keep orginal code the maximum that.Thanks RichardM by code. Quote Link to comment Share on other sites More sharing options...
JackStone Posted March 17, 2016 Share Posted March 17, 2016 Hi all,I was going to make my own topic for this, but since this post is so recent, I will add my question to this post, hopefully it will get seen.I am also having issues with this resource. I have the code compiling with no difficulties, and I have created the example door provided with the resource in my level.With the door closed, I cannot pass through it, which is expected.I can then call %obj.opendoor(), which plays the open animation, provided the player isn't blocking the door, this is expected.However, even with the door open, I still can't pass through, it seems there is an issue with the collision. This is the same issue I had with doors, which is why I downloaded this pack.I also cannot play the closedoor() animation at all, it returns 0, even when the player is not blocking the door.I tried this with and without the code changes given in this thread.I think we really need a good door resource working and included in the engine, it is a standard feature with any game project. If I can't get the working, I will have to resort to my usual method of creating doors, which is to create a door object with no collision, then create another invisible object with collision, and move the invisible object as the door opens using .settransform(). This works, but it's not ideal, I'm sure we can do better! Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted March 16, 2017 Share Posted March 16, 2017 I have a door working with collisions and all using the basic shape base datablocks and two triggers so you know which way the person is at the door so it always swings away from the player, u don't need an extra resource to do this lik Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.