Modding Help Custom Race .LUA Emitter

Discussion in 'Starbound Modding' started by Omeruin, Jan 20, 2020.

  1. Omeruin

    Omeruin Void-Bound Voyager

    Heya! I'm making another custom race and I was wondering if I could have a specific Race emit particles WITHOUT THE USE OF STATUS EFFECTS.
    I scoured the LUA wiki, I have been through the files, I even read a LUA tutorial! But I'm not quite getting it, I guess. I am trying to learn LUA more so I can do more interesting things such as this! Any help would be appreciated!

    ---

    I initially thought if I had a .LUA file and an animation file, that maybe those could work together, but I just realized that the animation file itself has to be connected to something else (like an effect) to truly work. (By setting that file to use the animation AND the script..)
    Is there some way to set an particle emitter without the need for an animation file? Or do I need an animation file and I have it wrong?

    This is the .LUA:
    Code:
    function init()
      if player.species("nebulac", true) then
      animator.setParticleEmitterActive("flames", true)
      end
    end
    
    function uninit()
      origUninit()
    end
    And this is the animation file:
    Code:
    {
        "particleEmitters": {
            "flames": {
                "enabled": true,
                "emissionRate": 3.0,
                "particles": [{
                        "particle": "astraltearsparkle1"
                    },
                    {
                        "particle": "astraltearsparkle2"
                    },
                    {
                        "particle": "astraltearsparkle3"
                    }
                ]
            }
        }
    }
    And *this* is the error I get:
    Code:
    [22:14:57.825] [Info] Root: Preparing Root...
    [22:14:57.826] [Info] Root: Done preparing Root.
    [22:14:57.826] [Info] Client Version 1.4.4 (windows x86_64) Source ID: 8cbe6faf22282659828a194e06a08999f213769e Protocol: 747
    [22:14:57.826] [Info] Root: Scanning for asset sources in directory '..\assets\'
    [22:14:58.199] [Info] Root: Scanning for asset sources in directory '..\mods\'
    [22:14:58.271] [Warn] Root: Unrecognized file in asset directory 'mods_go_here', skipping
    [22:14:58.272] [Info] Root: Detected asset source named 'base' at '..\assets\packed.pak'
    [22:14:58.272] [Info] Root: Detected asset source named 'xbawks' at '..\mods\xbawks'
    [22:14:58.272] [Info] Root: Detected asset source named 'Ancient Pets' at '..\mods\Ancient Pets'
    [22:14:58.272] [Info] Root: Detected asset source named 'Dragon Pet Pack' at '..\mods\Dragon Pet Pack'
    [22:14:58.272] [Info] Root: Detected unnamed asset source at '..\mods\Hallowed Planets'
    [22:14:58.272] [Info] Root: Detected unnamed asset source at '..\mods\Nebulac'
    [22:14:58.272] [Info] Root: Detected asset source named 'Skittles Basic Race Template' at '..\mods\Quatl race for starbound'
    [22:14:58.272] [Info] Root: Detected asset source named 'Smol Weapon Pack' at '..\mods\Smol Weapon Pack'
    [22:14:58.272] [Info] Root: Detected asset source named 'The Angels of Starbound' at '..\mods\The Angels of Starbound'
    [22:14:58.272] [Info] Root: Detected asset source named 'The Angels of Starbound-Glowing Racial Buff Addon' at '..\mods\The Angels of Starbound-Glowing Racial Buff Addon'
    [22:14:58.272] [Info] Root: Detected unnamed asset source at '..\assets\user'
    [22:14:58.272] [Info] Loading assets from: '..\assets\packed.pak'
    [22:14:58.738] [Info] Loading assets from: '..\mods\xbawks'
    [22:14:58.738] [Info] Loading assets from: '..\mods\Ancient Pets'
    [22:14:58.744] [Info] Loading assets from: '..\mods\Dragon Pet Pack'
    [22:14:58.748] [Info] Loading assets from: '..\mods\Hallowed Planets'
    [22:14:58.781] [Info] Loading assets from: '..\mods\Nebulac'
    [22:14:58.801] [Info] Loading assets from: '..\mods\Quatl race for starbound'
    [22:14:58.815] [Info] Loading assets from: '..\mods\Smol Weapon Pack'
    [22:14:58.818] [Info] Loading assets from: '..\mods\The Angels of Starbound'
    [22:14:58.907] [Info] Loading assets from: '..\mods\The Angels of Starbound-Glowing Racial Buff Addon'
    [22:14:58.907] [Info] Loading assets from: '..\assets\user'
    [22:14:59.695] [Info] Assets digest is 47a443ecb37a7500c851ed32ed85c796b811120cb8d7055f71738bd695b09c34
    [22:14:59.695] [Info] Root: Loaded Assets in 1.8694 seconds
    [22:14:59.696] [Info] Application: Initializing SDL Video
    [22:14:59.699] [Info] Application: Initializing SDL Joystick
    [22:14:59.771] [Info] Application: Initializing SDL Sound
    [22:14:59.890] [Info] Failed to initialize Steam platform services
    [22:14:59.892] [Info] Initialized Discord platform services
    [22:14:59.895] [Info] Application: Creating SDL Window
    [22:15:00.248] [Info] Application: Enabling VSync with late swap tearing
    [22:15:00.283] [Info] Application: Opened default audio device with 44.1khz / 16 bit stereo audio, 2048 sample size buffer
    [22:15:00.290] [Info] OpenGL version: '4.6.0 NVIDIA 441.12' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 960/PCIe/SSE2' shader: '4.60 NVIDIA'
    [22:15:00.294] [Info] Application: initialization...
    [22:15:00.295] [Info] Root: Loaded Configuration in 0.0008145 seconds
    [22:15:00.298] [Info] Application: renderer initialization...
    [22:15:00.301] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 128
    [22:15:00.301] [Info] Root: Loaded ImageMetadataDatabase in 1.20001e-06 seconds
    [22:15:00.305] [Info] Application: main update loop...
    [22:15:00.332] [Info] Root: Loaded NameGenerator in 0.017905 seconds
    [22:15:00.456] [Info] Root: Loaded PlantDatabase in 0.123917 seconds
    [22:15:00.585] [Info] Root: Loaded ProjectileDatabase in 0.12885 seconds
    [22:15:00.606] [Info] Root: Loaded ObjectDatabase in 0.291623 seconds
    [22:15:00.673] [Info] Root: Loaded NpcDatabase in 0.0673074 seconds
    [22:15:00.675] [Info] Root: Loaded StagehandDatabase in 0.0014855 seconds
    [22:15:00.680] [Info] Root: Loaded VehicleDatabase in 0.005072 seconds
    [22:15:00.684] [Info] Root: Loaded PlayerFactory in 0.0044021 seconds
    [22:15:00.702] [Info] Root: Loaded MonsterDatabase in 0.117255 seconds
    [22:15:00.703] [Info] Root: Loaded VersioningDatabase in 0.0007085 seconds
    [22:15:00.703] [Info] Root: Loaded EntityFactory in 0.0186899 seconds
    [22:15:00.731] [Info] Root: Loaded ParticleDatabase in 0.0278167 seconds
    [22:15:00.855] [Info] Root: Loaded MaterialDatabase in 0.152087 seconds
    [22:15:00.858] [Info] Root: Loaded TerrainDatabase in 0.0031368 seconds
    [22:15:00.888] [Info] Root: Loaded BiomeDatabase in 0.0303891 seconds
    [22:15:00.889] [Info] Root: Loaded LiquidsDatabase in 0.0005338 seconds
    [22:15:00.894] [Info] Root: Loaded StatusEffectDatabase in 0.0045135 seconds
    [22:15:01.101] [Info] Root: Loaded DamageDatabase in 0.207276 seconds
    [22:15:01.104] [Info] Root: Loaded EffectSourceDatabase in 0.003555 seconds
    [22:15:01.107] [Info] Root: Loaded FunctionDatabase in 0.0025067 seconds
    [22:15:01.125] [Info] Root: Loaded TreasureDatabase in 0.0179612 seconds
    [22:15:01.337] [Info] Root: Loaded DungeonDefinitions in 0.212348 seconds
    [22:15:01.337] [Info] Root: Loaded TilesetDatabase in 2.73e-05 seconds
    [22:15:01.339] [Info] Root: Loaded StatisticsDatabase in 0.0013963 seconds
    [22:15:01.339] [Info] Root: Loaded EmoteProcessor in 7.13e-05 seconds
    [22:15:01.344] [Info] Root: Loaded SpeciesDatabase in 0.0053612 seconds
    [22:15:01.358] [Info] Root: Loaded QuestTemplateDatabase in 0.0135991 seconds
    [22:15:01.359] [Info] Root: Loaded AiDatabase in 0.0009534 seconds
    [22:15:01.360] [Info] Root: Loaded TechDatabase in 0.000663 seconds
    [22:15:01.364] [Info] Root: Loaded CodexDatabase in 0.0044803 seconds
    [22:15:01.571] [Info] Root: Loaded BehaviorDatabase in 0.206919 seconds
    [22:15:01.573] [Info] Root: Loaded DanceDatabase in 0.002053 seconds
    [22:15:01.578] [Info] Root: Loaded SpawnTypeDatabase in 0.004627 seconds
    [22:15:01.581] [Info] Root: Loaded RadioMessageDatabase in 0.0034667 seconds
    [22:15:03.064] [Info] Root: Loaded ItemDatabase in 2.36285 seconds
    [22:15:03.177] [Info] Root: Loaded CollectionDatabase in 1.59613 seconds
    [22:15:03.919] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [22:15:04.698] [Info] Root: Writing runtime configuration to '..\storage\starbound.config'
    [22:15:05.962] [Info] UniverseServer: Acquiring universe lock file
    [22:15:05.963] [Info] UniverseServer: Loading settings
    [22:15:05.964] [Info] UniverseServer: Starting UniverseServer with UUID: c0cc0803f7fe77bb972e5bdb2bf304d7
    [22:15:05.971] [Info] UniverseServer: Logged in player 'Nebulie' locally
    [22:15:05.971] [Info] UniverseServer: Logged in account '<anonymous>' as player 'Nebulie' from address local
    [22:15:06.044] [Info] UniverseServer: Loading system world (-931724474, -570569338, -87306930) from disk storage
    [22:15:06.046] [Info] UniverseClient: Joined server as client 1
    [22:15:06.088] [Info] UniverseServer: Reviving player at ClientShipWorld:ed04d1a36e48bafed2bf3b2df2ff523a
    [22:15:06.088] [Info] UniverseServer: Client 'Nebulie' <1> (local) connected
    [22:15:06.117] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [22:15:06.117] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [22:15:06.121] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [22:15:06.145] [Info] UniverseServer: listening for incoming TCP connections on 0.0.0.0:21025
    [22:15:06.145] [Info] UniverseServer: Loading client ship world ClientShipWorld:ed04d1a36e48bafed2bf3b2df2ff523a
    [22:15:06.226] [Info] Protected dungeonIds for world set to (65524)
    [22:15:06.448] [Info] UniverseServer: Warping player 1 to ClientShipWorld:ed04d1a36e48bafed2bf3b2df2ff523a=1043.5.1024
    [22:15:06.666] [Error] Exception while calling script init: (LuaException) Error code 2, [string "/scripts/nebulacsparkle.lua"]:3: attempt to index a nil value (global 'animator')
    stack traceback:
        [C]: in metamethod '__index'
        [string "/scripts/nebulacsparkle.lua"]:3: in function <[string "/scripts/nebulacsparkle.lua"]:1>
    [0] 7ff630e2a213 Star::captureStack
    [1] 7ff630e28f9e Star::StarException::StarException
    [2] 7ff630dfcfb1 Star::LuaEngine::handleError
    [3] 7ff630fde9bb Star::LuaEngine::callFunction<>
    [4] 7ff630fe2513 Star::LuaFunction::invoke<Star::Variant<Star::Empty,bool,__int64,double,Star::LuaString,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> >
    [5] 7ff63145fd5f Star::LuaContext::invokePath<Star::Variant<Star::Empty,bool,__int64,double,Star::LuaString,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> >
    [6] 7ff631461647 Star::LuaBaseComponent::init
    [7] 7ff6311101d0 Star::Player::init
    [8] 7ff631341f92 Star::WorldClient::initWorld
    [9] 7ff63133feaa Star::WorldClient::handleIncomingPackets
    [10] 7ff6312b5653 Star::UniverseClient::handlePackets
    [11] 7ff6312b6905 Star::UniverseClient::update
    [12] 7ff630d75da7 Star::ClientApplication::updateRunning
    [13] 7ff630d7473d Star::ClientApplication::update
    [14] 7ff63153d4d1 Star::SdlPlatform::run
    [15] 7ff63153d68d Star::runMainApplication
    [16] 7ff630d77731 WinMain
    [17] 7ff6317207af __scrt_common_main_seh
    [18] 7ff9a2717bd4 BaseThreadInitThunk
    [19] 7ff9a348ced1 RtlUserThreadStart
    [22:15:06.674] [Info] Setting discord join secret as connect:discord_178775279982870528_668700009083961345_3d03f7d83f1892e9
    [22:15:10.688] [Info] UniverseClient: Client disconnecting...
    [22:15:10.700] [Info] Client received world stop packet, leaving: Removed
    [22:15:10.894] [Info] UniverseServer: Client 'Nebulie' <1> (local) disconnected for reason:
    [22:15:10.894] [Info] UniverseServer: Stopping idle world ClientShipWorld:ed04d1a36e48bafed2bf3b2df2ff523a
    [22:15:11.177] [Info] UniverseServer: Stopping UniverseServer
    [22:15:11.177] [Info] UniverseServer: Stopping TCP Server
    [22:15:11.274] [Info] Deleting discord server lobby 668700009083961345
    [22:15:11.443] [Error] Could not connect delete server lobby (err 0)
    [22:15:12.309] [Info] Application: quit requested
    [22:15:12.309] [Info] Application: quitting...
    [22:15:12.309] [Info] Application: shutdown...
    [22:15:12.459] [Info] Root: Shutting down Root
    [22:15:12.648] [Info] Application: Destroying SDL Window
    [22:15:12.746] [Info] Deleting discord server lobby 668700009083961345
    [22:15:12.747] [Info] Application: stopped gracefully
    
    Once again, any help is appreciated!
     

Share This Page