Team Spartan Cookies & Milk Forums
[Solved] New Changes to SF Stargate Functions - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Help and Support (https://teamscm.co.uk/forum-8.html)
+--- Thread: [Solved] New Changes to SF Stargate Functions (/thread-934.html)

Pages: 1 2


[Solved] New Changes to SF Stargate Functions - Salira - 24-05-2015

Since the last server update with the more secure private stargates, I've been trying to fix the dialing computer that I have. My only problem is getting the group and making sure of whether it should be included or excluded from the address string. Is it possible you could add a function like this?

Code:
stargate.addressRelative(gate1, gate2) --AND gate1:addressRelative(gate2)
If gate2 is private, returns an empty string "". Otherwise, returns the address gate1 must dial to establish a wormhole to gate2, including the group if it's a different group or both are Universe gates too far away for a 7 symbol connection.


RE: New Changes to SF Stargate Functions - Person8880 - 24-05-2015

Nope. That's called doing the work for you. Wink

It's not too hard to figure out the rules of the gate address system. There wouldn't be any fun or challenge in having it done for you. That's why the entity dialling was removed in the first place.


RE: New Changes to SF Stargate Functions - Salira - 24-05-2015

(24-05-2015, 05:54 PM)Person8880 Wrote: Nope. That's called doing the work for you. Wink

It's not too hard to figure out the rules of the gate address system. There wouldn't be any fun or challenge in having it done for you. That's why the entity dialling was removed in the first place.

Alright. The least I need to know is the range at which universe gates will have to use the 8th chevron to connect with each other, and how to calculate the distance between two entities.


RE: New Changes to SF Stargate Functions - Person8880 - 24-05-2015

The distance for SGU gates using the 8th chevron is 16000 units, and calculating the distance between two entities is:
function EntityDistance( Ent1, Ent2 )
return Ent1:pos()Big Grinistance( Ent2:pos() )
end



RE: New Changes to SF Stargate Functions - Salira - 25-05-2015

(24-05-2015, 09:26 PM)Person8880 Wrote: The distance for SGU gates using the 8th chevron is 16000 units, and calculating the distance between two entities is:
function EntityDistance( Ent1, Ent2 )
return Ent1:pos()Big Grinistance( Ent2:pos() )
end

Thanks. Smile


RE: [Solved] New Changes to SF Stargate Functions - Person8880 - 25-05-2015

Check the code again, just realised I wrote how to do it in GLua and not Starfall!

Basically change GetPos() to pos().


RE: [Solved] New Changes to SF Stargate Functions - LocInt - 25-05-2015

Seems kind of pointless to calculate the distance since stargate.address(gate) will automatically give you the right address configuration which is kind of stupid.


RE: [Solved] New Changes to SF Stargate Functions - Person8880 - 25-05-2015

(25-05-2015, 01:21 PM)LocInt Wrote: Seems kind of pointless to calculate the distance since stargate.address(gate) will automatically give you the right address configuration which is kind of stupid.
It doesn't? It only gives the 6 symbol base address, not the group or the correct ending.


RE: [Solved] New Changes to SF Stargate Functions - LocInt - 25-05-2015

(25-05-2015, 01:52 PM)Person8880 Wrote:
(25-05-2015, 01:21 PM)LocInt Wrote: Seems kind of pointless to calculate the distance since stargate.address(gate) will automatically give you the right address configuration which is kind of stupid.
It doesn't? It only gives the 6 symbol base address, not the group or the correct ending.

My mistake. But well you can see the whole address from addressList and then you just add few if statements for matching target gate class and done. No need for distance calculations.


RE: [Solved] New Changes to SF Stargate Functions - Person8880 - 25-05-2015

Address list just gives you what the UI gives you. If you know someone's gate address, but it's private, then you do need to know how far away it is if your gate and their gate are both the universe type.