Welcome to AC Web.
Page 5 of 5 FirstFirst ... 345
Results 61 to 72 of 72
  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,172
    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
    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

  8. #68
    Looks amazing!! What kind of engine do you use?
    wow server list
    Last edited by YourGamingDude; 06-19-2019 at 02:34 PM.

  9. #69
    Quote Originally Posted by YourGamingDude View Post
    Looks amazing!! What kind of engine do you use?
    Thank you! I use MonoGame.

  10. #70
    This looks really cool man! Keep up the work.
    Interested in seeing where you manage to take this.

  11. #71
    Quote Originally Posted by Magictouch View Post
    This looks really cool man! Keep up the work.
    Interested in seeing where you manage to take this.
    I appreciate that, thank you very much
    I'm also interested in where it goes

  12. #72

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hey, everyone! Wanted to post an update ->

    Between a lack of motivation and confusion, I've been working on the server-side npc system and clustering as seen below:


    These fellas are spawned within an area as described within the server-side .tmx file:


    Cluster spawning is currently just simple psuedo-random rng:
    Code:
    var rand = new Random();
    foreach (var tmx in Spawns.Objects)
    {
        if (tmx.Name.ToLower() == "mobs")
        {
            var x = tmx.X;
            var y = tmx.Y;
            var width = tmx.Width;
            var height = tmx.Height;
    
            for (int i = 0; i < Creatures.Count; i++)
            {
                var creature = Creatures[i];
    
                var randX = rand.Next((int)x, (int)(x + width));
                var randY = rand.Next((int)y, (int)(y + height));
    
                creature.GUID = Guid.NewGuid().ToString();
                creature.Vector = new Vector()
                {
                    Direction = Vector.MoveDirection.South,
                    X = randX,
                    Y = randY
                };
            }
        }
    }
    ---

    Before moving forward to independent movement, I may refine this system, not sure yet. Any feedback/questions/comments is/are appreciated

 

 

Posting Permissions

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