Welcome to AC Web.
Page 5 of 5 FirstFirst ... 345
Results 61 to 67 of 67
  1. #61

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hey everyone! Just wanted to post some updated progress and looking for feedback. Here are a few in-game screenshots:

    Login


    Creation Screen


    In-game


    ---

    In-terms of the scripting, it's very barebones as I just wanted to test the idea before going forward with anything in terms of questing, leveling, starting data, etc,. Here's how they are loaded:

    Code:
    var scriptFiles = Directory.GetFiles(WorldSettings.GetSection("Data").GetString("scripts"), "*.dll");
    foreach (var file in scriptFiles)
    {
    	var fileName = file.Split('/')[2].Split('.')[0];
    	var fileFullPath = Path.GetFullPath(file);
    	var asmFile = Assembly.LoadFile(fileFullPath);
    	var asmType = asmFile.GetType(string.Format("{0}.ConsoleTest", fileName));
    	Scripts.Add(Activator.CreateInstance(asmType) as IScript);
    }
    
    foreach (var script in Scripts)
    	script.OnLoaded();
    Pretty obvious, I'm sure.

    The script projects reference Framework.dll as-of right now and uses it's objects:
    Code:
    using Framework;
    using System;
    
    namespace SampleScript
    {
        /// <summary>
        /// A basic sample-script.
        /// </summary>
        public class ConsoleTest : IScript
        {
            public void OnLoaded() => Console.WriteLine("My first script <3");
        }
    }
    Code:
    namespace Framework
    {
        /// <summary>
        /// Basic test-script interface.
        /// </summary>
        public interface IScript
        {
            void OnLoaded();
        }
    }

  2. #62
    Haha looks very cool, gonna follow this

  3. #63
    Quote Originally Posted by Kryxa View Post
    Haha looks very cool, gonna follow this
    I appreciate it

  4. #64
    cd ..

    Join Date
    May 2008
    Location
    Europe
    Posts
    2,168
    Quote Originally Posted by SolitudeGaming View Post
    Code:
    var scriptFiles = Directory.GetFiles(WorldSettings.GetSection("Data").GetString("scripts"), "*.dll");
    foreach (var file in scriptFiles)
    {
    	var fileName = file.Split('/')[2].Split('.')[0];
    	var fileFullPath = Path.GetFullPath(file);
    	var asmFile = Assembly.LoadFile(fileFullPath);
    	var asmType = asmFile.GetType(string.Format("{0}.ConsoleTest", fileName));
    	Scripts.Add(Activator.CreateInstance(asmType) as IScript);
    }
    
    foreach (var script in Scripts)
    	script.OnLoaded();
    Use string interpolation instead

    Code:
    var a = "Hello";
    var b = "World!"
    var s = $"{a} {b}";

  5. #65
    Quote Originally Posted by Zaxer View Post
    Use string interpolation instead

    Code:
    var a = "Hello";
    var b = "World!"
    var s = $"{a} {b}";
    facepalm
    I didn't even think about that. After spending hours with CS-Script and having it not work out, I just wanted something working as quick as possible xD Will change it, thank you ^^

  6. #66
    Keep it up man, one of the most epic projects i have seen around here so far!

  7. #67

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by id820 View Post
    Keep it up man, one of the most epic projects i have seen around here so far!
    I appreciate that a lot, thank you

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •