View Single Post
Old 08-03-2006, 11:32 AM   #7 (permalink)
Ashlar
Forum Expert
 
Join Date: Nov 2004
Location: Southeast Missouri USA
Age: 35
Posts: 283
Default

Glad you like it Cheetah2003
For the first day or so i kept wanting to yell either "station" or "workbench" everytime i restarted the server.


This is only for those having problems like Lokai was desribing...
If you are having no problems with using this mod, dont bother to read on because this only occurs when editing WB files that CS scripts are dependant on.

Lokai, I have been working on this, trying to get it where you could use it with no problems.

Like you said, it works great for smaller projects, but for larger ones that change lots of code throughout the scripts... yech!

I have been making a lot of tests and suchlike and while i have figured out how to create a "trailing effect" (See next paragraph), it isn't something that i recommend for use because it gets.... err, complex to know what is going on where.

What i am calling a "trailing effect" is that;
I have been able to get the cs compiler to load the wb.dll as a resource if it exists.
Meaning that:
1. You copy the cs and name the copy a wb.
2. Compile, the cs is still there, so it loads the cs cache and compiles the wb.
3. Shut the server back down.
4. Rename or remove the cs that you copied.
5. Restart the server to re-compile. (It has to compile the cs scripts since you deleted one of them, but it loads the Scripts.WB.dll as a resource.)

From this point on, the wb file IS the cs script as far as the cs compiler is concerned since it loads it.

Problem:
If you cannot compile a script as a wb, (the baseweapon problem), you cannot get a dll of it and the whole thing breaks down.... grr!



On the plus side, from this effect i believe it is possible to get the compiler to loop through all the scripts in the \Scripts folder, compiling them one at a time and creating assemblys for each of them as it goes and then using the dll's of them as resources for suceeding compiles.

I believe that code that does this would be the ultimate word in a developers test shard.
This way, the server would only compile scripts that have changed and load everything else.

Now, the only problem is that i do not know enough about the CSharpCodeProvider to code this 'Dynamic, hierarchical, compile and load in-line loop'!

*Ashlar sends out a plea for help to those who know more than he.*

Attached is the version that loads the wb.dll as a resource for the cs compiler in case you want to see it.
I also have in it that the wb compiler loads the cs.dll as a resource in hopes that it would help on the baseweapon problem.
It gives different warnings, but the error remains.
Quote:
+ BaseWeapon.cs.wb:
CS0122: Line 23: 'Server.Items.IDurability' is inaccessible due to its protection level.
ction level
( I do not yet understand why this error appears only in the wb script... pout )
Attached Files
File Type: cs ScriptCompiler.cs (24.9 KB, 14 views)

Last edited by Ashlar; 08-03-2006 at 09:28 PM.
Ashlar is offline   Reply With Quote