Starbound
Sem avaliações suficientes
[modding resource] Weapon Status Effect Script
   
Premiar
Adic. a Favoritos
Nos Favoritos
Desfavoritar
Tamanho:
Publicado em:
2.068 KB
13 mar. 2017 às 18:51
1 nota de alteração ( ver )

Subscreve para transferir
[modding resource] Weapon Status Effect Script

Descrição
this is a modding resource; it doesn't add any content by itself

Adds a script that, when in an activeitem context, will add the status effects mentionned in the item's config's statusEffects array.
The idea was to have weapons act like armors regarding status effects.

I see two ways of using it:

- When making a custom weapon, in the item's config, add the script in the scripts array and a statusEffects array, such as, for example in a gun
"statusEffects" : ["mudslow"], "scripts" : ["/items/active/weapons/ranged/gun.lua", "/scripts/weaponstateffect.lua"],
this would add the "mudslow" status effect whenever the gun's held.

- When spawning a custom item. For example, this command
/spawnitem broom 1 '{"scripts": ["/items/active/unsorted/broom/broom.lua", "/scripts/weaponstatuseffect.lua"], "statusEffects": ["mudslow"]}'
will spawn a broom that'll apply the mudslow status effect. As activeitem scripts are client-side, items spawned with this script, such as above, should work when used on servers / next to people who aren't running this mod.
But!! if you give someone who doesn't have this mod an item with the script referenced, they'll crash whenever they're going to hold it. This means they won't even be able to take it from their inventory into the bin. Subscribbing to this mod then deleting the item then unsubscribbing, or an inventory editor will be required to fix it. Same goes for uninstalling this mod.

tl;dr don't give an item you've made with the above command to someone who doesn't have this mod

Giving a non-existant status effect will probably not do anything except fill your log file with warnings, but still better to avoid.


This should be, otherwise, compatible with everything.
14 comentários
꧁ღⳆ⧹EvelithⳆ⧹ღ꧂ 12 jul. 2018 às 7:46 
Thank you! :hearts:
🐱  [autor] 12 jul. 2018 às 6:53 
Heck, it seems I got the name wrong in my example and you're the first to try it; the script's path should be "asset/scripts/weaponstateffect.lua", instead of "weaponstateffecttest".
Sorry! :sadcat:
꧁ღⳆ⧹EvelithⳆ⧹ღ꧂ 12 jul. 2018 às 6:21 
Hi there! I'm having a small problem, as soon as I add the script:["/items/active/weapons/melee/meleeweapon.lua", "/scripts/weaponstateffecttest.lua"],
to a melee weapon, I get an error:
Exception caught in client main-loop (AssetException) Error loading asset/scripts/weaponstateffecttest.lua
Any ideas?

... I just noticed, this was posted 2017 T_T
I still hope someone can help me!
🐱  [autor] 29 mai. 2017 às 3:23 
v (*along with your starbound.log file
🐱  [autor] 29 mai. 2017 às 3:23 
Seems like a typical Lua error; Your log file should contain additional infos, but if you need help, it'd probably be easier to get some if you made a thread to post your files along with your http://community.playstarbound.com/threads/how-to-report-mod-errors-fixing-most-problems-yourself-v1-1.69198/ on the Starbound's modding forums: http://community.playstarbound.com/forums/starbound-modding.111/
Bellum 28 mai. 2017 às 16:41 
It's me again, back with another question lol. I made a custom weapon and I think I did everything properly, but instead of giving a status effect when I hold the weapon, it just loses its animation and can't attack anymore. Do you know what might be going on? (I can post the whole .activeitem script if that helps)
🐱  [autor] 25 mai. 2017 às 9:55 
(woops, seems like I messed up my bold tag :CatWish:
Bellum 25 mai. 2017 às 9:54 
Neat. Thanks.
🐱  [autor] 25 mai. 2017 às 9:47 
Yep, as said in the bold " But![/but]" part, and as implied by the "[modding resource]" thingy. Steam provides a "required mods" feature, but if you don't want to have your users do this, you could unpack this mod and include it in your own :Neko:
Bellum 25 mai. 2017 às 9:05 
Quick question, if I were to use this script on an item in a mod, would people who installed that mod have to install this resource as well?