BloxGaming Forums
Our Servers => BloxGaming SB3 => Expression 2 (E2) Code => Topic started by: kevinminion on November 14, 2016, 10:58:44 pm
-
It's late, so maybe I'm just missing something...
I'm trying to use PlanetName = MyEntity:sbEnvName() to grab a list of all planet names in a map, but most everything I've tried to plug in for MyEntity returns an empty string.
PlanetName = owner():sbEnvName() returns the expected string
I've tried creating holos at the planet centers and then using PlanetName = Holo:sbEnvName() but that also returns an empty string.
Is there another way to get all of the planet names?
-
Look in E2Helper for getPlanetName. Just target the planet's entity, and give that to the function.
-
@bloxgate Thank you for the nudge in the right direction, the code snippet below is working for me now.
findByClass("logic_case")
Planets = findToArray() # returns array of entities
for(K=1,Planets:count()) {
ThisPlanet = Planets[K,entity]
print(K + ": " + getPlanetName(ThisPlanet) + " : " + ThisPlanet:pos())
}