Product Chat / Sliding door Lua ?

Author
Message
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 6th Dec 2016 21:19
Does anyone know how to make a sliding door---open and close without it being animated >??

Thx

UNIRD12B
Let\'s actually make something happen with this one !
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 6th Dec 2016 21:39
Using script, so this is mot script forum question, thought.
Anyway basically you need move door around X axis to open, and back to the original pos X to close door.
How far should slide door to be open?
Maybe this might help:

get distance between 2 objects (not player) & rotate an object to another object (not player)
https://forum.game-guru.com/thread/207801?page=5#msg2500807

Maybe you can use a second object, now you'll have to calculate dist between them, or the classic trial and error resource.

and this other one:

sliding/crushing wall trap
https://forum.game-guru.com/thread/207801?page=10#msg2531534

I ignore if they can solve your issue, anyway they are a good start point, I thought.

3com


Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 6th Dec 2016 21:42
Hi 3com,
I agree...great effort on your part...i will look into it more.

anyone else....other ideas ??

Thx

UNIRD12B


Let\'s actually make something happen with this one !
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 6th Dec 2016 22:34
there is a broadcast on it....
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++, SQL, PL-SQL, JavaScript, HTML, Darkbasic Pro (still love this language), Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; 12GB.
FPSC to GameGuru Tools: SegAutoWelder, Entity+Weapon Welder
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 6th Dec 2016 23:17
Use my ezentitymover.lua script, that's exactly the sort of thing it's for.
Been there, done that, got all the T-Shirts!
PM
granada
Forum Support
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 6th Dec 2016 23:43
If I remember right I put up some in the free models & media a while back as a download
Ready animated.

Dave
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 7th Dec 2016 00:42
Thx guys ,
all great help !
I'll try the mover Lua AmenMoses.
Granada...thx for the offer of animated ones , but i already have specific types
of things I want to be able to move.

Thx all for the great help as always !!!

UNIRD12B
Let\'s actually make something happen with this one !
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 7th Dec 2016 00:55
woo ok
Amen Moses , I tried all those scripts in the list you had
and was not able to figure out to get any of them to work and when i looked at the code
was just too easy to get lost in it.
Soooo.,.......hope springs eternal......

UNIRD12B

Let\'s actually make something happen with this one !
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 7th Dec 2016 20:07
Assuming you have chosen an entity to be a sliding door and have named it "Door" and made it active (and change it's weight to 0, not essential but sometimes helps) simply attach the ezentitymover.lua script to it and edit the movement list inside the script.

The movement list is the very first thing in the list and is made up of entries named to match the entity you want moving and a sequence of movements you want it to do.

So for a sliding door you might have an entry like this::

["Door"] = {"h","mx60","h","mx-60"}

Then you need a control script to trigger each sequence as you need it, for example when the player approaches the door to make it open and close when they moves away. There is an example in the last post on the thread in the scripts forum that you can play around with, that example has a sliding door so should suit you perfectly. (if you leave out the "h" entries then the door will simply open and then close again over and over again)

If your door is oriented differently then use "mz" or "my" or "mf" or "ms", just try them to see what happens.

The script can control as many doors as you want just make sure the entity linked to the control script is set to 'always active'.

Just under the movement list is another list which needs an entry matching in name, this list controls the detection of player on entity, for example if you want to detect if the player is on a trigger entity or platform you define the length, width and height of the entity so the script can work out the detection area, for a door this list just needs the default entry of ["Door"] = {radius = 0} which tells the script not to bother with detection.

Been there, done that, got all the T-Shirts!
PM
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 8th Dec 2016 03:09
Wow AmenMoses ,
thx so much for the extra info...
maybe now i can get a lil more sense of it.
was kind of you.

UNIRD12B
Let\'s actually make something happen with this one !
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 8th Dec 2016 05:36 Edited at: 8th Dec 2016 05:37
woo Ok ,
I was able to sit down and get the gate opener to work,
wohho
MY first Lua Script.

Thx to smallg and AmenMose
for tons of inspiration and help to get me going
and interested to even try it.
Its superrrrr simple my script not nearly as complex as theirs
but it seems to do what I want---
gate up when I get close
gate down when I go past.
Instructions are also included in the file on how to make it work.
let me know,,,thx.

also--its FREE for anyone to use

UNIRD12B
Let\'s actually make something happen with this one !

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-29 01:18:17
Your offset time is: 2024-09-29 01:18:17