Scripts / A little help with player transportation

Author
Message
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 20th Mar 2017 12:16
Carn't seem to get my head around this, i do have the multimap script smallg did bit i don't seem to be able to grasp how to do this. What I'm trying to achieve is i have quite a lot of non linear projects going which involve a space map in which you land on 1 of 6-8 planets, run around do your stuff then leave back to the space map.
The problem i have is that you do not arrive back at the planets location when you leave the planet you go back to the player start marker which is in the middle of the map at present meaning you then have "say if you forgot something" to travel all the way across the map (which seems like forever as a shrank the player to give the effect of a bigger map)
Is there a way i can do this ? and if so could anyone show me how please as my brains gone numb at the thought of it
If i could get 1 generic one working i could then adapt it to suit all the other projects Thanks
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 20th Mar 2017 12:52 Edited at: 20th Mar 2017 12:54
I assume you mean you want them to land at the same coordinates they left?

If so i think it can be done.

If i'm right the way i would do it is ....

1. In a zone marker placed on the start marker make a script with something like this (note: can't remember the actual commands but you might be able to work it out)



2. Then in the script you use to launch, add a line to save your X Y and Z position to planetnameX, planetnameY, and planetnameZ

Theoretically this would work by the launch script saving your XYZ location as a global (which carries over between levels) then when you land on that planet you will trigger the zone marker, which checks the global and if there are numbers other than 0 in those globals it transports you to those number.

I don't know if it will work, i've probably got it wrong, but it's an idea.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Mar 2017 13:36
would it be better to have a teleporter system where you can choose the marker to go to?
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 20th Mar 2017 14:02
@ Belidos thanks m8 will check that out in a bit @ smallg hmm no m8 i just need the player to arrive outside the planet he or she just left as there are trading stations on the map relative to the planet you leave if you get me, so say you have been on a planet collecting minerals you then have to travel a bit to get the highest price for them. also the need to arrive at a set point outside the planet means i can use the memoryzone script to save all the info.
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 20th Mar 2017 14:06
Or perhaps using checkpoints.

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
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 20th Mar 2017 16:07 Edited at: 20th Mar 2017 20:58
Ok day finished can have a look now @ 3com checkpoints? @ belidos kinda get that, ive written all of the things that you collect g_iron etc etc into the return zone how do i get the xyz co ords? and would i need 3 entries for all 8 planets as the returnzone, memoryzones and is getting a rather long script and dont want to over bloat it
@ smallg i suppose you could use the teleporter but just have 1 location maybe = outside the planet you just left that might work


Hmm nope still confused.com
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
Mortt
8
Years of Service
User Offline
Joined: 16th May 2016
Location:
Posted: 20th Mar 2017 20:21
So.
After you leave the planet surface. The player goes to the start, which is the middles of the main space map.
What you want is, that after the player leaves the planet surface, you want to be orbiting the planet before leaving the star system.

Then when player is sure he has everything, then to leave the planet orbit and go to another place.

Then to go back to the planet it is a repeat of the orginal script that you used to put him on the planet.
(Have smale png icon to represent player in orbit around planet)


Use the script that send him to the cente of the map, "the start location" and adapt the location to the "Current Loation". Then when he is in orbit use the script to send him to the next place.

I think that this is what you are trying to do.
(Custom) Intel i7 3.3 Mhz. 16 GB fast ram. EVGA Nvidia 560 Ti 4GB. Dell US27 2560 x 1440. AOC 24 1920 x 1080. Awesome.
Next G. Card EVGA GeForce GTX 970 Superclocked ACX 2.0 Gaming 4GB GDDR5 PCIe3.0 Graphics Card.
Would Like EVGA NVIDIA GeForce GTX 1080 8GB GDDR5X PCIe3.0 Graphics Card
PM
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 20th Mar 2017 20:39 Edited at: 20th Mar 2017 22:25
I have 8 physical planets, 3 asteroid fields and around 10 -15 dockable space stations on the Main Space map in system 1.
All 8 planets are landable = seperate maps, on which you can hunt, forage, scavenge and mine for minerals and chemicals to earn credits
The player start marker is in the middle of the main space map just outside the main trading station = seperate map.
All 8 Planets are at different locations around the Main space map for system 1.
what im trying to do is when the player finishes mining, hunting etc etc on planet 1 he arrives next to planet1 on the main space map not in the middle
the same for planet 2,3,4,5,6,7 and 8.
I can do this for 1 planet using transportinzone but my scripting skills = not so good at all dont stretch far enough to script to do all 8 planets :/ lol *picks his head up off the desk after trying this for the last couple of hours* sort have got this so far with the intention of when you are on planet1 have a zone marker with g_planet1 == 1 now i have to find a way to transport to the coordinates instead of the if used field and disable the g_planet1 with i would presume g_planet1 == 0
.. I'm winging this lol ( oh doesnt look like we have a transport to coordinates command )

Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Mar 2017 07:31
You can simply move the entity you are transporting to.
Been there, done that, got all the T-Shirts!
PM
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 21st Mar 2017 13:56 Edited at: 21st Mar 2017 15:53
Using what AM? transportto "planet1" or moveto "planet1"? whats the move command im looking for here m8? can you show me the correct syntax please
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 21st Mar 2017 16:01 Edited at: 21st Mar 2017 16:02
Easy way.



In action - I press 1 to go to barrel1 (planet1), 2 to go to barrel2 (planet2), etc.



Notice I'm using 8 planets, so if you want more you've has to edit that value by yours.
Notice too I've coded error, so you can't enter nan values or greatets than 8.
If you want to use more than 9 planets, you'll need to re-write the code, so you'll need 2 digits (10,11,12, etc)

hth
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
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

Attachments

Login to view attachments
PM
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 21st Mar 2017 17:16 Edited at: 21st Mar 2017 18:17
Hmm That is using a button press tho isnt it 3com m8 i want to automatically transport the player after leaving planet1 = map2 to the position of planet1 on map one (see pic), if i am returning from planet2 map3 i want to arrive at planet 2's position on this map, same for 3,4,5,6 etc . this needs to be done automatically so as the player doesnt see themself arrive at the start marker.
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on

Attachments

Login to view attachments
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Mar 2017 17:55 Edited at: 21st Mar 2017 17:56
Assuming you know what the coordinates are for where you want to transport simply move the entity to those coordinates using ResetPosition(e,x,y,z) then transport to the entity, put the coordinates in a list and select the entry you need from the list.
Been there, done that, got all the T-Shirts!
PM
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 21st Mar 2017 18:07 Edited at: 21st Mar 2017 18:21
i can get the coordinates from the bottom right of the screen yes? I could use an object if thats possible just a tiny bit of space debris maybe? but obviously not use the if used field as that only caters for 1

so something along the lines of
If g_planet1 == 1 then
ResetPosition(e,x,y,z)

yeah could list the coord's ok i've np with that (i think)

im ok with doing the scripting to save the planet as active part just the arrival on the main map has me stumped as scripting really isnt my bag, but im trying lol also the co-ords in the editor shows 2? its a flat map with all stations the same height so would i need 4?

or entity number?
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
Mortt
8
Years of Service
User Offline
Joined: 16th May 2016
Location:
Posted: 21st Mar 2017 20:12
Was just thinking of this youtube from Lee.


Make Your Own Teleport With LUA
https://www.youtube.com/watch?v=ahDKFlVs55w

Could you set up this on each planet to then go to the new spawn point which is the planet and not the surface and not the start.

Each planet can have a "Teleport" .

Just a thought.
(Custom) Intel i7 3.3 Mhz. 16 GB fast ram. EVGA Nvidia 560 Ti 4GB. Dell US27 2560 x 1440. AOC 24 1920 x 1080. Awesome.
Next G. Card EVGA GeForce GTX 970 Superclocked ACX 2.0 Gaming 4GB GDDR5 PCIe3.0 Graphics Card.
Would Like EVGA NVIDIA GeForce GTX 1080 8GB GDDR5X PCIe3.0 Graphics Card
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Mar 2017 20:51
Attach this to an entity and it will display the coordinates accurate to 2 decimal places.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 21st Mar 2017 23:42 Edited at: 22nd Mar 2017 15:03
ok thanks m8 :0 will check it out tomorrow brains gone fudgy after spending all night getting the new W.I.P finished
p.s its a freebie give it a go its actually pretty good fun you'll see your heli script in it working m8 awesome and ty

Edit : very handy AM
Planet 1 x=34601.94, y=600, z=13399.64, ang=0
Planet 2 x=32525.71, y=600, z=11078.99, ang=0
Planet 3 x=47811.38, y=600, z=3939.65, ang=0
Planet 4 x=5098.62, y=599.99, z=5278.87, ang=0
Planet 5 x=3985.09, y=599.99, z=47673.1, ang=0
Planet 6 x=45831.62, y=600, z=46144.71, ang=0
Trading station x=2509.78, y=599.99, z=30430.71, ang=0

I've attached the scripts to cubes just outside of each planet that all look right to you m8?
so it would start to look like this?

Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 22nd Mar 2017 19:10
here you go, i think i understood your intention correctly?
set a zone around the current start marker in the hub world with transporttoplanet.lua
set some barrels or entity with the desired planet name in their name (must be g_planet1, g_planet2 etc - it's purely for linking purposes so don't worry if they're not really planets or whatever), the barrels will not show so don't worry you can keep your empty space
give them transportlocation.lua

now in the planet's winzone (the planet you are leaving to reach the hub world) you need to add 1 line to tell it which planet you are leaving *do this when the player is in the zone about to transport to the next level*, for example

means you are leaving planet 1

means you are leaving planet 2
etc
this does mean all winzones need to be different unless you have a way to change that number per level (can be done by name etc but you'll need to adjust the script yourself as i don't have it).


didn't test on multilevels but i see no reason it won't work as intended.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 22nd Mar 2017 19:54 Edited at: 24th Mar 2017 21:53
That looks totally what i needed m8 Np editing the winzone individually smallg many thanks m8 really appreciate that

Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-12-23 04:36:56
Your offset time is: 2024-12-23 04:36:56