Scripts / Any chance to set "ifused field", via escript?

Author
Message
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 8th Apr 2015 11:46
Hi everyone
So as title say, I wish to determine "ifused field" via script.
Imagine I've 2 possible sides to go via teletrasporter. I can go to point A and B.
The problem is that I can only go to the place previewsly determine via entity properties>ifused field.

Ignore if can I set various destination points via properties>>ifused field, perhaps separate them by comas, ie: pointA, pointB, and so on.

So I can choose via script where player want to go. IE: if you want to go pointA press "a", if you want pointB then press "b", and so on.

So..



Is there something like this and maybe I had missed it ?

If not, it's a good time for considere it.

3com







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

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

PM
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 8th Apr 2015 12:22 Edited at: 8th Apr 2015 12:26
Try to use the same script.lua as both main entities, then in the entities option use that "If Used" field.
For example: for door 1 Use key? = YES, If Used? = open door 2 (of course, you must got a key in this example)
them at door 2 : Use key? = door 1, If used? = open door ...
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 8th Apr 2015 13:35
Thanks Old Larry.
Unfortunatelly this is not exactly my point. I'll try to explaint it with an example:
Imagine scenario:
Player is in a building.
Player find an elevator.
Player can go from floor 1 to floor 3, or 2, or 4ยบ.

How can I state this?
How can I allow the player being able to choose, wich floor he want to go?
How can I to get the elevator stopping in the desired floor?

If I only can to set one place to go, via entety properties panel>>If Used field?
Tis is the question.

I want to be able to set this value (ifused field) via script, and have the flexibility for setup varios places as destination point, not just one, via properties panel.

Right now, via properties panel I only can go to one floor with the lift, or in my case with the teletransporter.

But I want the player being able to choose wathever floor he want, as destination point.

3com


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

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

PM
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 8th Apr 2015 13:38 Edited at: 8th Apr 2015 13:42
That can be solved with multiple elevators with separate scripts of highest each, and to be spawn one by one.
Elevator 1 going to floor 1 then spawn elevator 2....something like that....
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 8th Apr 2015 13:45
I think so, but may be easier add some new lua command to do so.
If you've a 20 floors bulding, you can not have 20 lifts.

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

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

PM
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 8th Apr 2015 14:32
3com wrote: "If you've a 20 floors bulding, you can not have 20 lifts."

That's sure
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Apr 2015 17:13
You would still need 20 entities to teleport to though because you would need them all named different to know which location is which if you do it via that method.

My advice is to find the co ords of each location and then move the entity before you teleport to it, that way you only need 1 target entity but you can teleport anywhere
Or simply set dummy entities as targets, move the entity you use to teleport to that dummy entity, just need to know the entity number rather than co ords then and then teleport.

I will try upload a working example tomorrow
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 8th Apr 2015 17:59 Edited at: 8th Apr 2015 18:18
Quote: "Or simply set dummy entities as targets, move the entity you use to teleport to that dummy entity, just need to know the entity number rather than co ords then and then teleport."


Yeah! perhaps some decal (fingerprints ?).

I've tried your lift2,lua script with my platform, but if I set physics=yes in my platform properties panel, then the platform does do nothing. But if I set physics=no, then the script work, the platform go up, but player stay over the ground.

So I decided to try teletransport script (tele.lua). It work nice, but I only can go to one place, those setup in properties panel.

Thanks for hepl me again.

Edit: adding some pic.



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

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

PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 9th Apr 2015 14:14
new teleporter script https://forum.game-guru.com/thread/207801?page=7#msg2514628
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Login to post a reply

Server time is: 2024-12-30 16:22:06
Your offset time is: 2024-12-30 16:22:06