Articy Script field conversion

Announcements, support questions, and discussion for the Dialogue System.
irve
Posts: 53
Joined: Fri Jan 15, 2016 9:35 am

Articy Script field conversion

Post by irve »

I am building instructions which run only once. Dialogue System seems to convert Articy strings in functions into variables, discarding quotes:

modify_once("category.variable", 2) gets converted into:
modify_once("Variable["category.variable"]", 2)

I think we'd like the strings to remain, as I see ourselves using set_name("some name") or similar at some point. For variables, now, it is possible to work around it and make a function which returns a number to add only once and then 0, but the syntax will confuse the writers a lot.

category.variable = category.variable + once(1) is the possible workaround
User avatar
Tony Li
Posts: 20993
Joined: Thu Jul 18, 2013 1:27 pm

Re: Articy Script field conversion

Post by Tony Li »

As a rule, should the converter leave the contents of strings untouched? If so, I'll go ahead and make that change.
irve
Posts: 53
Joined: Fri Jan 15, 2016 9:35 am

Re: Articy Script field conversion

Post by irve »

When thinking of Articy "dialect" of scripting, the converter should probably be able to convert ShowMessage("asd") and ShowMessage("quote \" quote") if we get lucky :)
User avatar
Tony Li
Posts: 20993
Joined: Thu Jul 18, 2013 1:27 pm

Re: Articy Script field conversion

Post by Tony Li »

That's certainly do-able, too. So the converter will leave the content of strings untouched, except it will handle nested quotes properly.
irve
Posts: 53
Joined: Fri Jan 15, 2016 9:35 am

Re: Articy Script field conversion

Post by irve »

It would help our cause to have this improvement in conversion.
User avatar
Tony Li
Posts: 20993
Joined: Thu Jul 18, 2013 1:27 pm

Re: Articy Script field conversion

Post by Tony Li »

I'll try to have a patch ready for you by next Monday morning if not sooner.
User avatar
Tony Li
Posts: 20993
Joined: Thu Jul 18, 2013 1:27 pm

Re: Articy Script field conversion

Post by Tony Li »

Sorry for the delay in releasing this patch. It's now available on the customer download site.
jghesquiere
Posts: 10
Joined: Thu Aug 04, 2016 10:58 am

Re: Articy Script field conversion

Post by jghesquiere »

Hello,

I have a question about Articy conversion too, so i post it here. (tell me if i have to make a new thread)

In Articy, i create a dialogue fragment that play a sequence with a picture. Here is the script :

Code: Select all

using UnityEngine;
using System.Collections;
using PixelCrushers.DialogueSystem;
using UnityEngine.UI;

namespace PixelCrushers.DialogueSystem.SequencerCommands {

	public class SequencerCommandShowImage : SequencerCommand {
		GameObject imgPanel;

		public void Start() {
			var currentEntry = DialogueManager.CurrentConversationState.subtitle.dialogueEntry;
			var imageName = Field.LookupValue(currentEntry.fields, "Image");
			Debug.Log(imageName);

			// A changer
			imgPanel = GameObject.Find("Image Panel UI");
			imgPanel.GetComponent<Image>().sprite = Resources.Load<Sprite>("Images/" + imageName);

			StartCoroutine(FadeUp());
		}

		public void Update() {
			if (Input.GetMouseButtonDown(0)) {
				StartCoroutine(FadeDown());
			}
		}

		public void OnDestroy() {
			imgPanel.GetComponent<Image>().color = new Color(1, 1, 1, 0);
		}


		#region Lerp Alpha
		IEnumerator FadeUp() {
			for (float time = 0; time < 100; time++) {
				imgPanel.GetComponent<Image>().color = new Color(1, 1, 1, time / 100);
				yield return new WaitForSeconds(0.001f);
			}
		}

		IEnumerator FadeDown() {
			for (float time = 100; time > 0; time--) {
				imgPanel.GetComponent<Image>().color = new Color(1, 1, 1, time / 100);
				yield return new WaitForSeconds(0.001f);
			}
			Stop();
		}
		#endregion
	}


}

With this script, I get the name of the picture (string) then I load the correct picture from the folder.
But when I try to set the "Dropdown as" field to Ints in the Articy Convert windows, it change my picture string to something weird as : 0x01000000000007E5
It works with Strings.

I need to set the "Dropdown as" to Ints because is use it for the others sequences.

How can I do ?

Thank you

Image
User avatar
Tony Li
Posts: 20993
Joined: Thu Jul 18, 2013 1:27 pm

Re: Articy Script field conversion

Post by Tony Li »

Hmm, I'll take a look at the dropdown conversion rule and reply back on that later today. The "0x01000000000007E5" is an articy:draft internal ID.

However, the bigger issue is that it sounds like you want to convert some dropdowns as strings and others as ints. Currently the converter handles all dropdowns the same way.

What about including the image name in the sequencer command, such as: ShowImage(Dossier Obstetrical).

If that won't work for your needs, I could add an option to the converter to let you specify how to handle each dropdown. Let me know if you'll need this option.
jghesquiere
Posts: 10
Joined: Thu Aug 04, 2016 10:58 am

Re: Articy Script field conversion

Post by jghesquiere »

Maybe it could be a great idea to implement this feature. :)
Are "Slots" in Articy works like dropdown ?
Because I use slots in Articy to drag n drop the correct picture.
Post Reply