No Joy on DLL

This is the error I get for the DLL. I did the WSDL collect then the CSC compile into a DLL on my PC then copied the DLL to my IMac into a folder I called Custom under my Assets folder.

Did I do something wrong?


35692–1307–$ai_107.cs (4.43 KB)

It looks like a version problem to me. SendOrPostCallback is new to .NET 2.0, and Unity’s Mono doesn’t have most 2.0 features.

-Jon

SendOrPostCallback exists in Mono, its AsyncCompletedEventArgs that is missing, but I think your right, a version mismatch. Going to reset my paths and lib to 1.1 from 2.0 and try.

Edit:
Ok, I have to use the wsdl for 1.1, but can use the csc of 2.0 and no errors, now to do further testing. Thanks for the fast response, now to get a response from the web server :slight_smile:

New delima, almost home free.
How would I use it in C# in unity?

In vs2003, I add it as a web reference, then call it by simply:
webreference name.AI (in my case)
com.jbwws.www.AI test=new com.jbwws.www.AI();

Then simply
string res=test.UpdateInventory(“test”);
MessageBox.Show(res);

EDIT :

WOHHOOOO
Nevermind!
Here is what I had to do with it:

AI test=new AI();
string res=test.UpdateInventory(“test”);
Debug.Log(res);

And I’ll be a monkeys uncle if Debug.Log didn’t show test!
(actually it did show test)
This is obviously not yet tested as a web build, going to play with that some more, but the mac build is talking sweetly to my webservice as far as I can tell.

35707–1308–$ai_110.cs (2.06 KB)

New problem, I am trying to troubleshoot why the result doesn’t give me the external message on my client as played through the web browser, I know data is sent and received because right now until I optimize it with more threads, I get a ‘milisecond’ hickup when picking up the axe next to the church.

So I tried to modify that code as follows:

public class GetObject : MonoBehaviour {

	AI test;
	string res;
	// Use this for initialization
	void Start () {
		test=new AI();
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void OnTriggerEnter (Collider other) {
		res=test.UpdateInventory("AXE");
		Debug.Log(res);
		yield res;
		if (test.error != null)
		{
		    Application.ExternalCall ("DisplayMessage", error);	
		}
		else
		{
			Application.ExternalCall ("DisplayMessage", res);
		}
		
	}
}

I do not know how to use yield in C#, what is the java equivelant for yield in C# in Unity? This is the error I get:

(Edit) forgot to mention, I couldn’t find try / catch in the docs, and this tells me that ‘Exception’ could not be found, looking for namespace or assembly

		try
		{
		}
		catch(Exception ex)
		{
		}

Check out using coroutines in C# : http://unity3d.com/Documentation/ScriptReference/index.Writing_Scripts_in_Csharp.html

I just skimmed your code but your solution could be as simple as returning IEnumerator instead of void. Also are you using UnityEngine; up top?

-Jon

Found the Exception, I had to include
using System;

However, yield doesn’t exist for C#, thats my problem right now, regarless of that link, I tried to include the same namespaces it does (which includes the following)

using UnityEngine;
using System.Collections;
using System;

But it still can’t find yield…

edit:
Any idea what other class I need to utilize to get yield to work?
I see there is a YieldInstruction class, but I can’t use it in my using statements.

#4 here – http://unity3d.com/Documentation/ScriptReference/index.Writing_Scripts_in_Csharp.html

Sorry, but I don’t seem to be very clear in this:
yield return 0;

yield does not exist in C#.
10,000 links to that page won’t fix this error:
And yes, I am including:
using UnityEngine;
using System.Collections;
using System;

Trying to find out why the triggers are only sending Debug.Log 1 time, after the first trigger hit for OnTriggerEnter, if I go to another object then come back, it doesn’t do a Debug.Log for the object again, probably some trigger reset I have to do somewhere in code.

Please read the error so you see what I am asking, I don’t need a link to that page again.

I think you need to come back down to Earth and communicate your problem better. Maybe with a zipped project if you can’t figure it out. We’re all trying to help, thanks…

Are there more errors in the Console?

-Jon

Please rewrite this properly. I have no idea what you are trying to say.

-Jon

using UnityEngine;
using System.Collections;
using System;

public class GetObject : MonoBehaviour {

	AI test;
	string res;
	// Use this for initialization
	void Start () {
		test=new AI();
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void OnTriggerEnter (Collider other) {
		try
		{
			res=test.UpdateInventory(name);
			Debug.Log(res);
			updateRoutine();
		
			Application.ExternalCall ("DisplayMessage", res);
		}
		catch (Exception ex)
		{
			Application.ExternalCall ("DisplayMessage", ex.ToString());
			Debug.Log(ex.ToString());
		}
		
	}
	IEnumerator updateRoutine () {
        // Wait for one frame
        yield return 0;
        
        // Wait for two seconds
        // yield return new WaitForSeconds (2);
    }			
}

Thanks, I know your trying to help, it just gets a slightly frustrating when mutiple people post the same link to the same article pointing out the same routine. This is the code after you suggested the IEnumerator with the same error about yield.

Being frustrated about the yield error, I have moved on past it and now trying to figure out the trigger event as to why it doesn’t retrigger. The Debug.Log only shows the axe05 name one time when I go over that axe, then when I go over axe01 it shows its name, then when I come back to axe05 it doesn’t show the debug log with the name of axe05 again, so there is probably a property for the trigger to determine if it has already been triggered or something. Still looking through the docs.

MSDN documentation on yield (C#): http://msdn2.microsoft.com/en-us/library/9k7k7cf0(VS.80).aspx

By default the Unity console won’t show repeated messages; that’s the first thing to check (it’s a toggle button called Collapse, I think–I’m not at my Mac).

Thanks, that collapse toggle is a stress reliever. I’ll find another way to work with items asyncronously using threads instead, then I don’t have to worry about it as much. Not going to worry about yield anymore.

Edit, here is a snapshot of my efforts so far, each item in the debug is sent/ retrieved via webservice command, the debug log is the string result of the webservice answer.

Thanks again everyone for your help on this.