playMaker

Author Topic: get level name of level id x  (Read 2833 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
get level name of level id x
« on: June 12, 2018, 05:12:19 PM »
hello! it would be handy to be able to

put all level names into an string array fsm variable.

an action called "get level name of level build id x" would allow this to happen, but I can't find such a thing.

also, is ArrayMaker now obselete since array variables are a part of playmaker itself?
« Last Edit: June 12, 2018, 05:14:16 PM by westingtyler »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: get level name of level id x
« Reply #1 on: June 12, 2018, 05:56:23 PM »
Hi,
Try 'Get Scene name' :)

ArraMaker is definitely not obsolete :)
It is more advanced than the standard and a big advantage is that it uses references.
And Array maker includes also Hash Tables :)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: get level name of level id x
« Reply #2 on: June 12, 2018, 06:03:51 PM »
thanks for the fast reply!

haha SCENE name. I searched everywhere for LEVEL, but not SCENE.

what is a reference, and why is that an advantage for arraymaker?

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: get level name of level id x
« Reply #3 on: June 12, 2018, 06:55:00 PM »
I have it set up, but I get this error when I try to use Get Scene Name, using Scene at Index as Scene Reference:

create scene list : from build settings : get and stamp scene name : GetSceneName : Scene index "1" is out of range.
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.FsmLog:AddEntry(FsmLogEntry, Boolean) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmLog.cs:171)
HutongGames.PlayMaker.FsmLog:LogAction(FsmLogType, String, Boolean) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmLog.cs:392)
HutongGames.PlayMaker.FsmStateAction:LogError(String) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmStateAction.cs:207)
HutongGames.PlayMaker.Actions.GetSceneActionBase:OnEnter() (at Assets/PlayMaker/Actions/SceneManager/Internal/GetSceneActionBase.cs:92)
HutongGames.PlayMaker.Actions.GetSceneName:OnEnter() (at Assets/PlayMaker/Actions/SceneManager/GetSceneName.cs:32)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:199)
HutongGames.PlayMaker.FsmState:OnEnter() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:169)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2670)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2628)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2556)
HutongGames.PlayMaker.Fsm:Start() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1851)
PlayMakerFSM:Start() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:501)

and i get more of the same error, counting from 1 to 65 (the max number of levels in my build.)
« Last Edit: June 12, 2018, 07:08:28 PM by westingtyler »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: get level name of level id x
« Reply #4 on: June 13, 2018, 05:33:13 AM »
Hi.
Refference is similar to the variable name, but is a string

When you use arrays for a grid based game its easier to access the needed array with a Refference (string) than a group of variables.
Also array list has some more advanced actions like for example :
- Array List Sort Game Object By Distance.
-Array List Get Average Value

For the error you are getting :

Did you add your scenes in the build settings?



westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: get level name of level id x
« Reply #5 on: June 13, 2018, 05:50:40 PM »
I'm pretty sure they're added in the build settings. I've been making builds for months with these levels and they work fine. And yet, even 1 is out of range.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: get level name of level id x
« Reply #6 on: June 14, 2018, 05:09:17 AM »
Hi.
The reason is that the action does not search in the build.
It searches in the hierarchy.

I added an action to your other post, but i will add it here also.
Can you let me know if it works and if i need to add something, so that i can place it on the Ecosystem :)