Spawn resources

FlyDozFlyDoz Member
What function in .lua spawn resources? looks like
fy_Bricktron:New(faction, Random.VoxelAround(spawnPoint.position)):SetOccupation(Occupations.Archer)
I whant to create mod for spawn sulfur by function CorruptedDead( corrupted )

Comments

  • ShatojonShatojon Administrator Developer Backer Wiki Editor
    Hey FlyDoz!

    I'll try to get you an answer from a dev. Sit tight :)
  • SamhainSamhain Administrator
    edited May 2019
    Hey FlyDoz, I would need to know exactly what kind of brimstone you're trying to spawn.

    If you want to spawn it inside a stockpile, or if you want loose brimstone pebbles on the floor, I might be able to help you.

    If you want it on the terrain as a ressource you can mine, I'm afraid you can't do this only by modding the lua files. Adding ressources the way you do with the world editor brushes in the middle of a game is really not supported. If you can code in C# and you want to try anyway, check out electroz's mod loader, it might help you : http://forums.castlestory.net/discussion/7793/mod-loader-the-new-way-to-mod-also-my-teamcorruptron-event-3-submission#latest
  • FlyDozFlyDoz Member
    Thanks, I will try to change corraptrons to drop sulfur and metall instead of stone
  • FlyDozFlyDoz Member
    edited June 2019
    //Example dll C# Net 4.5.2 :
    ///////////////////////////////////////////////
    using System;
    using Brix.External.Factories;
    using Brix.Game.AI;
    using Brix.Lifecycle.Pooling;
    using PluginBase;
    using UnityEngine;

    namespace ClassLibrary3{
    public class Class1 : CSPlugin {
    public string Description{
    get {
    return "asdasd!";
    }
    }
    public string Name {
    get {
    return "asd";
    }
    }
    public bool Active { get; set; }

    public void OnGui(){}

    public void Update(){}

    public void Start(){}

    public void Stop(){}
    }
    }
  • Samhain said:

    Hey FlyDoz, I would need to know exactly what kind of brimstone you're trying to spawn.

    If you want to spawn it inside a stockpile, or if you want loose brimstone pebbles on the floor, I might be able to help you.

    If you want it on the terrain as a ressource you can mine, I'm afraid you can't do this only by modding the lua files. Adding ressources the way you do with the world editor brushes in the middle of a game is really not supported. If you can code in C# and you want to try anyway, check out electroz's mod loader, it might help you : http://forums.castlestory.net/discussion/7793/mod-loader-the-new-way-to-mod-also-my-teamcorruptron-event-3-submission#latest

    I would like to spawn loose pebbles on the floor. I've looked through the LUA files but could not find any code for it (except I think brimstone pebbles are "OrangeCrystal", iron ore is "RawIron", and plant pieces are called "Plant" but please correct me if I'm wrong). How should I go about doing this?
  • ShatojonShatojon Administrator Developer Backer Wiki Editor
    Hey @NewModder !

    I strongly recommend you join the Discord, there's a modding channel there and Samhain read these forums actively since he is no longer employed at Sauropod, but he is somewhat active on the Discord :)

    https://discord.gg/CastleStory

    See you there!
  • A simplified function of one I've made in lua, same with "RawIron" :
    function DropOre(item)
    local close1 = FindClosestFromKey(item, fy_Bricktron, nil)
    close1:FillWithRessource("OrangeCrystal")
    end
    Hooks.Connect(fy_Magitron.hk_OnTypeDestroy, DropOre)
    When it spawns a bag on a militray unit you just SHift+RMB on ground to drop it
Sign In or Register to comment.