Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Jan 18, 2016 at 07:50 PM by Victors for the following reason:

Problem is not reproducible or outdated

avatar image
0
Question by Victors · Jan 04, 2013 at 07:15 AM · androidjavascriptconsoledialogue

Got a problem with script 4 dialogues

Hi hi all, so i've got a problem with a script, i think that's 'cos in Unity 4 javascript shouldn't have some Boo elements. But in fact i don't know, how i can liquidate a problem. So, that's a script:

 public var dialogueSkin : GUISkin;
 public var startOn : int = 0;
 public var defaultImg : Texture2D;
 public var defaultAudio : AudioClip;
 public var dialogue : DialogueEntry[] = [new DialogueEntry()];
 public var display : DialogueEntry = new DialogueEntry();
 public var waitTime : float = 0.2;
 public var lineCount : int = 0;
 public var timeStart : float = 0.0;
 public var textSpeed : float = 80.0;
 public var parsedText : String[];
 public var pwEntry : String = "";
 public var toLoad : int = -1;
 public var curItem : int = 0;
 public var history : Array = new Array();
 public var phase : int = 0;
 public var curContent : GUIContent = GUIContent("");
 public var glow : float = 0;
 public var aud : AudioSource;
 public var bools : boolean[] = [false,false,false,false];
 public var ints : int[] = [0,0,0,0];
 public var strings : String[] = ["","","",""];
 public var jumpto : int;
 public var s : Vector2 = Vector2.zero;
 
     
 class DialogueEntry {
     public var longText : String;
     public var img : Texture2D;
     public var choices : DialogueChoice[];
     public var choiceMode : int = 1;
     public var links : Link[];
     public var next : int;
     public var editor : boolean;
     public var pos : int = 0;
     // 0 - top, 1 - bottom, 2 - middle
     public var passwords : DialogueChoice[];
     public var incorrect : int;
     public var exit : DialogueChoice;
     public var align : int;
     public var mode : int;
     public var narration : AudioClip[];
     public var script : String;
     // 0 - next, 1 - choice, 2 - password, 3 - event, 4 - end
     function DialogueEntry () {
         longText = "New entry";
         next = 0;
         editor = false;
         incorrect = 0;
         align = 0;
         exit = new DialogueChoice("Exit");
         mode = 0;
     }
 }
 class DialogueChoice {
     public var shortText : String;
     public var next : int;
     public var editor : boolean;
     function DialogueChoice () {
         shortText = "New Choice";
         editor = false;
     }
     function DialogueChoice (s:String) {
         shortText = s;
         editor = false;
     }
 }
 class Link {
     public var shortText : String;
     public var url : String;
     function Link () {
         shortText = "URL Description";
         url = "http://";
     }
 }
 
 function Start () {
     Restart ();
 }
 
 function OnEnable () {
     Restart();
 }
 
 function OnDisable () {
     if (aud) {
     if (aud.clip) {
         if (aud.isPlaying) aud.Stop();
     }
     }
 }
 
 function Update () {
     var text = parsedText[lineCount];
     var chars = (Time.time-timeStart)*textSpeed;
     if (chars0) {
 if (display) {
 GUI.skin = dialogueSkin;
 if (curContent) {
     switch (display.pos) {
         case 0:
             GUILayout.BeginHorizontal("textbox",GUILayout.Width(Screen.width));
             if (display.align==0&&curContent.image) GUILayout.Label(curContent.image,"img");
             GUILayout.Label(curContent.text,"text");
             if (display.align==1&&curContent.image) GUILayout.Label(curContent.image,GUILayout.Width(256));
             GUILayout.EndHorizontal();
         break;
         case 1:
             GUI.Box(Rect(0,Screen.height-120,Screen.width,120),curContent,"textboxplayer");
         break;
         case 2:
             GUI.Box(Rect(30,Screen.height/2-60,Screen.width-60,120),curContent,"textboxmiddle");        
         break;
     }
 /*    for (var l in display.links) {
         GUILayout.Button(l.shortText);    
     }*/
     DoNextButton();
 }
     if (display.choices) {
         if (display.choices.length>0&&lineCount>=parsedText.length-1&&display.mode==1) {
             if (display.choiceMode==1) {
                 ShowWheel();
             } else {
                 ShowList();    
             }
         }
     }
     }
     }
     }
 }
 
 function DoNextButton () {
     switch(display.mode) {
     case 0:
     if (lineCount0) {
             if (GUI.Button(Rect(0,Screen.height-163,Screen.width/2,43),display.choices[0].shortText,"r1c1active")) toLoad=display.choices[0].next;    
         } else {
             GUI.Label(Rect(0,Screen.height-163,Screen.width/2,43),"");
         }        
         if (display.choices.length>1) {
             if (GUI.Button(Rect(Screen.width/2,Screen.height-163,Screen.width/2,43),display.choices[1].shortText,"r1c2active")) toLoad=display.choices[1].next;    
         } else {
             GUI.Label(Rect(Screen.width/2,Screen.height-163,Screen.width/2,43),"");
         }
         if (display.choices.length>2) {
             if (GUI.Button(Rect(0,Screen.height-120,Screen.width/2,40),display.choices[2].shortText,"r2c1active")) toLoad=display.choices[2].next;    
         } else {
             GUI.Label(Rect(0,Screen.height-120,Screen.width/2,40),"");
         }
         if (display.choices.length>3) {
             if (GUI.Button(Rect(Screen.width/2,Screen.height-120,Screen.width/2,40),display.choices[3].shortText,"r2c2active")) toLoad=display.choices[3].next;    
         } else {
             GUI.Label(Rect(Screen.width/2,Screen.height-120,Screen.width/2,40),"");
         }
         
         if (display.choices.length>4) {
             if (GUI.Button(Rect(0,Screen.height-80,Screen.width/2,51),display.choices[4].shortText,"r3c1active")) toLoad=display.choices[4].next;    
         } else {
             GUI.Label(Rect(0,Screen.height-80,Screen.width/2,51),"");
         }
         if (display.choices.length>5) {
             if (GUI.Button(Rect(Screen.width/2,Screen.height-80,Screen.width/2,51),display.choices[5].shortText,"r3c2active")) toLoad=display.choices[5].next;    
         } else {
             GUI.Label(Rect(Screen.width/2,Screen.height-80,Screen.width/2,59),"");
         }
 
 }
 
 function ShowList () {
     GUILayout.BeginArea(Rect(0,Screen.height-150,Screen.width,150),"","box");
     s = GUILayout.BeginScrollView(s);
     for (var c in display.choices) {
         if (GUILayout.Button(c.shortText,GUILayout.Height(30))) toLoad = c.next;    
     }
     GUILayout.EndScrollView();
     GUILayout.EndArea();
 }
 
 function ProgressLineCount () {
     timeStart = Time.time;
     lineCount++;
     PlayClip (curItem);
 }
 
 function FixedUpdate () {
     if (toLoad!=-1) {
         LoadDialogue(toLoad);
         s = Vector2.zero;
     }
     toLoad = -1;
 }
 
 function StartGlow () {
     GUI.color.a = glow;
 }
 
 function EndGlow () {
     GUI.color.a = 1.0;
 }
 
 function PlayClip (i:int) {
     if (aud.clip) {
         if (aud.isPlaying) aud.Stop();
     }
     if (dialogue[i].narration) {
         if (dialogue[i].narration.length>lineCount) {
             if (dialogue[i].narration[lineCount]) {
                 aud.clip = dialogue[i].narration[lineCount];
                 aud.loop = false;
                 aud.Play();
             }
         }
     }
 }

Console write me: "`UnityScript.Scripting.IEvaluationDomainProvider' interface member implementation must be public or explicit." Help me, please. P.S. sorry for my english

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Jan 04, 2013 at 07:15 AM 0
Share

for any help, please format your code. You can do this by highlighting all your code, then clicking the 10101 button at the top of the edit window.

Though, it may be easier just to delete the code, paste it in again from the source, then highlight all the code and press the 101010 button at the top of the edit window before posting. When you don't mark your code as code, the text gets html escaped and it gets really hard to reformat it.

EDIT : I have formatted this one for you. Please check the code is the same as what you have.

avatar image Victors · Jan 04, 2013 at 07:51 AM 0
Share

Thank you, i'll do that next time

avatar image sharpshot124 · Jan 04, 2013 at 11:34 AM 0
Share

can u tell us what line(s) the error(s) is on?

avatar image Victors · Jan 04, 2013 at 12:42 PM 0
Share

Sure. Full message:

Assets/Resources/Scripts/DialogueInstance.js(1,1): BCE0172: `UnityScript.Scripting.IEvaluationDomainProvider' interface member implementation must be public or explicit.

avatar image sharpshot124 · Jan 04, 2013 at 12:54 PM 1
Share

it appears that the error is from the very start do you have #pragma strict? if so try deleting it

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Setting Scroll View Width GUILayout 1 Answer

Can someone help me fix my Javascript for Flickering Light? 6 Answers

I need help making this script work for android touchscreen 0 Answers

How do i need to change this script for mobile? 1 Answer

Execute String as Code Line? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges