PlayMaker Help & Tips > PlayMaker Help

Long type?

(1/2) > >>

derkoi:
I'm trying to make my own actions and I need to use the type "long", I tried FsmLong but it appears it's not supported?

The actions are for Playtomic that I'm trying to add so I can't just use an Int instead.  :(

Also when I try and use a FsmString for a string variable in this line of code, it won't allow it.

gameid needs to be a long, guid & apikey are strings


--- Code: ---Playtomic.Initialize(gameid, "guid", "apikey");
--- End code ---

Any ideas how I can add this? Thanks

jeanfabre:
Hi,

 yes, you'll need to convert to int unfortunately, it's the same with some date functions that uses long, I haven't found a work around that myself.

 bye,

 Jean

derkoi:
Ah right, I just edited the original post as I cant get the strings to work either. I tried this:


--- Code: ---using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("Playtomic")]
[Tooltip("Initializes Playtomic.")]
public class PlaytomicInitialize : FsmStateAction
{

public string guid;
public string apikey;

[RequiredField]
// [UIHint(UIHint.Variable)]
public FsmString appGuid;
[RequiredField]
public FsmString appApikey;
// [RequiredField]
// public FsmLong gameid;

public override void Reset()
{
appGuid = null;
appApikey = null;

}

public override void OnEnter()
{
if (gameid == null) return;
if (appGuid == null) return;
if (appApikey == null) return;

guid = appGuid;
apikey = appApikey;
Playtomic.Initialize(gameid, guid, apikey);

Finish();
}


}
}

--- End code ---

I get this error:

Assets/My Playmaker Actions/Playtomic Actions/PlaytomicInitialize.cs(35,25): error CS0029: Cannot implicitly convert type `HutongGames.PlayMaker.FsmString' to `string'

jeanfabre:
Hi,

 FsmXXX variable are wrappers, so you have to use the .Value to get and set them

so:

--- Code: ---appGuid.Value = guid;
guid = appGuid.Value;

--- End code ---

the same apply to ALL FsmXXx types.

bye,

 Jean

derkoi:
Great, thanks Jean!  :)

Any idea how i should convert the int to a long?

Navigation

[0] Message Index

[#] Next page

Go to full version