naptimeshadows Posted January 15, 2017 Share Posted January 15, 2017 Hello! I am making a custom staff, and I want it to set things on fire like the Firestaff. The code from the "staff" code doesn't do this, and a lot of the animation lines hint that the color off the staff is an external value that determines what "staff" code activates. What line of code do I need to tell the game that my staff is red? I see no other scripts other than this and FX lua, neither of this contain the values. Link to comment https://forums.kleientertainment.com/forums/topic/73393-staff-color-lua/ Share on other sites More sharing options...
Lumina Posted January 15, 2017 Share Posted January 15, 2017 I guess the firestaff doesn't set things on fire. I think it throw a projectile, and the projectile set things on fire. Maybe you just need your staff to do the same thing, throwing the projectile setting things on fire. Link to comment https://forums.kleientertainment.com/forums/topic/73393-staff-color-lua/#findComment-858532 Share on other sites More sharing options...
naptimeshadows Posted January 15, 2017 Author Share Posted January 15, 2017 Yep, I have that included. I literally copied the entire Red code into my staff. Not sure what I am missing, since this whole project is guesswork. I want the staff to glow, and set things on fire. Let me know if you see any glaring issues. dragonstaff_start.lua Link to comment https://forums.kleientertainment.com/forums/topic/73393-staff-color-lua/#findComment-858539 Share on other sites More sharing options...
Lumina Posted January 15, 2017 Share Posted January 15, 2017 Ok, so i'm not the best to see if something is wrong, but First, i'll say that you need : local prefabs = { --"ice_projectile", "fire_projectile", "staffcastfx", "stafflight", --"staffcoldlight", --"cutgrass", } Not sure about which one you need exactly, but i'm sure you need at least fire_projectile. Also, if you look at the end of the staff file, you have : return Prefab("icestaff", blue, assets, prefabs), Prefab("firestaff", red, assets, prefabs), Prefab("telestaff", purple, assets, prefabs), It's here that you say "my staff is linked to the red function" or whatever color you want. And in the red function you'll see : local function red() local inst = commonfn("red", { "firestaff", "rangedfireweapon", "rangedlighter" }) And it's the part linking the red function to the common function used by all the staff. So at least you need something like : return Prefab("common/inventory/dragonstaff_start", red, assets, prefabs) And local function fn() Changed into : local function commonfn(colour, tags) Because this part is telling the game "i use the common function and i add the colour part (here, red) and the tags related (here, "firestaff", "rangedfireweapon", "rangedlighter" ) So i guess you could change things to make only one big function, but this way to do allows you to add more staff in the future with different color if you want to. I'm not sure all these changes are needed, i'm not sure all will work, and i'm not sure if some others things are wrong too, but i hope it will help. Link to comment https://forums.kleientertainment.com/forums/topic/73393-staff-color-lua/#findComment-858547 Share on other sites More sharing options...
naptimeshadows Posted January 16, 2017 Author Share Posted January 16, 2017 All I was really missing was the "red" at the bottom. Do I really need to recreate all the other prefabs? Isn't there a way to call on the Red and Fire_projectile functions already in the game? Link to comment https://forums.kleientertainment.com/forums/topic/73393-staff-color-lua/#findComment-858732 Share on other sites More sharing options...
Aquaterion Posted January 16, 2017 Share Posted January 16, 2017 i believe that adding the tag "rangedlighter" makes it able to light things on fire, from a distance. Link to comment https://forums.kleientertainment.com/forums/topic/73393-staff-color-lua/#findComment-858767 Share on other sites More sharing options...
Lumina Posted January 16, 2017 Share Posted January 16, 2017 4 hours ago, naptimeshadows said: Do I really need to recreate all the other prefabs? You don't need to recreate the files in "local prefab" but you need to call them, because you are saying the game "i need theses files for my prefab". So for example you don't need to recreate Fire_projectile since it already exists, you just need to tell the game "my prefab will need Fire_projectile". I'm not entirely sure about what you are asking so maybe it's not what you want to know... Link to comment https://forums.kleientertainment.com/forums/topic/73393-staff-color-lua/#findComment-858780 Share on other sites More sharing options...
Boogiepop210 Posted August 26, 2022 Share Posted August 26, 2022 The command for burning stuff is c_select().components.burnable:Ignite(true) I'm guessing you can make it so when you click on an prefab this happens Link to comment https://forums.kleientertainment.com/forums/topic/73393-staff-color-lua/#findComment-1595936 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now