Articy Script field conversion
Articy Script field conversion
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
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
Re: Articy Script field conversion
As a rule, should the converter leave the contents of strings untouched? If so, I'll go ahead and make that change.
Re: Articy Script field conversion
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
Re: Articy Script field conversion
That's certainly do-able, too. So the converter will leave the content of strings untouched, except it will handle nested quotes properly.
Re: Articy Script field conversion
It would help our cause to have this improvement in conversion.
Re: Articy Script field conversion
I'll try to have a patch ready for you by next Monday morning if not sooner.
Re: Articy Script field conversion
Sorry for the delay in releasing this patch. It's now available on the customer download site.
-
- Posts: 10
- Joined: Thu Aug 04, 2016 10:58 am
Re: Articy Script field conversion
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 :
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
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
Re: Articy Script field conversion
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.
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.
-
- Posts: 10
- Joined: Thu Aug 04, 2016 10:58 am
Re: Articy Script field conversion
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.
Are "Slots" in Articy works like dropdown ?
Because I use slots in Articy to drag n drop the correct picture.