Page 1 of 1
Posted: 2017-03-02, 12:20
The game I hoping to do is more an adventure game not a shooter, it will be a first person view
The game will be in a regular house with opening swing doors like any home... so on that note, what is the best way to do this?
An animated door or rotate the door by script?
Would it be possible to trigger the door by a mouse/cursor click on the door handle?
Also locked doors requiring a key?
Posted: 2017-03-02, 13:07
Have you seen http://forum.cafu.de/viewtopic.php?p=6915#p6915
I may rewrite this in greater detail if required.
An adventure is a great idea, I'm very much looking forward to it!
Posted: 2017-03-02, 15:20
Yes I did see it, I'm not very good with lua
I'll persevere a while longer, I'll create a door in the context and I'll see if I can get it working
Can the door be a model? I don't appear to be able to get a model to move and I've noticed that the lifts etc examples are primitives.
Posted: 2017-03-02, 15:38
Yes, doors can be models, just add a component as required.
Let me know if you need help.
Posted: 2017-03-02, 17:59
I will don't worry
Posted: 2017-03-03, 14:49
Ok I know have a door triggering but not a swing motion, looking at the MoverBinary this hasn't been added yet?
I thought it might be able to use something like
I'm not to bothered if the door swings instantly open from 0 to 90 degrees right now, I can try to make it better later
Posted: 2017-03-04, 12:02
I've added an issue for this, please see https://bitbucket.org/cafu/cafu/issues/ ... nentmovert
I'll look into it, but if you want a quick solution, just move the doors out of the way linearly.
Posted: 2017-03-04, 12:17
I guess the "easier" solution would be to animate the door?
Have a range of 100 frames, frames 0 to 49 open the door, frame 50 to 100 close it
Can we call a particular frame range?
Posted: 2017-03-04, 18:57
In theory (I'm quite sure but have not tried), this can be done, especially if you can make it so that the door has two animation sequences: opening and closing.
The better solution however is (fixing #156
and) using the MoverBinary.
Posted: 2017-03-04, 19:19
The MoverBinary is a lot more use to me as I'm a Sketchup user, we can't export animation
I'm trying an animated door with Blender
But even the Blender game engine uses a script rather than animation
Posted: 2017-03-05, 11:18
it was really easy to get the door to open
Code: Select all
local Trigger = ...
-- Don't re-enter this code while we're still busy.
if self.IsBusy then return end
self.IsBusy = true
local Map = world:GetRootEntity()
local AniRun= Map.doorani:GetComponent("Model")
Console.Print("Door close triggered!\n")
-- Wait 2.1 secs, then become available again for the next trigger action.
self.IsBusy = false
I guess now I need to figure out either a mouse/cursor click action or maybe keyboard input? ie a message to click a key to open or close
Posted: 2017-03-06, 10:24
arfur9 wrote:I guess now I need to figure out either a mouse/cursor click action or maybe keyboard input? ie a message to click a key to open or close
At this time, the easiest solution by far is to use a trigger volume, possibly a very thin one so that the player must be very close to the door in order to open it (or have his key inventory checked).
Next easiest solution is using a GUI panel.
If you want something like a "Use" key, I'd have to look into it. Key mapping is not something that works easily or well yet.
Posted: 2017-03-06, 12:03
Right now I have a trigger close to the door with a isopen condition, most doors once open can stay open, it would be exterior doors that need to close
Have you had any luck with the GUI problem?
Posted: 2017-03-07, 11:55
I was looking into the rotating movers issue #156
first, because that is the slightly simpler problem and I was not aware if there are any priorities.
, don't expect results too quickly: this is a complicated problem that requires careful planning.
Posted: 2017-03-07, 14:37
I'm just interested, the GUI is a nice feature