DC_DarklingJoin Date: 2003-07-10Member: 18068Members, Constellation, Squad Five Blue, Squad Five Silver
you may want to go in more detail which folders you need for which mod.
For example.. Using a viewmodel skin.
* Do I only need models folder?
* Do I need to use the builder, or am I better of copying it to the output folder?
* I want to change x thing, where do I need to start? Materials? Maps?
Make it as insanely dumb as you possibly can. I always let folk who have no clue test how to's and manuals. If they can do it, anyone can.
(my questions were rhetorical, I dont need a answer to them)
Nice, managed to apply fire effects to the pistol. Eventually I'll figure out how to increase bullet damage and lower firing speed, and then import a revolver model. :P
Open the UberShotgun.lua file and type the following:
function Shotgun:ApplyBulletGameplayEffects(player, hitEnt, impactPoint, direction, damage, surface, showTracer) if HasMixin(hitEnt, "Fire") then hitEnt:SetOnFire(player, self) end
end
I assume that this is calling various effects functions within the NS2 code?
What I'd like to know is how to find the NS2 code to know where I find these named functions.
Nice, managed to apply fire effects to the pistol. Eventually I'll figure out how to increase bullet damage and lower firing speed, and then import a revolver model. :P
This is possibly the greatest idea since sliced bread was invented. WTB Squishpoke revolver mod!
Alright, question of the century: I did the effect to the rifle, and while that was cool and all... How would I go about making a welder that sets things ablaze (BadlyEngineeredWelder)? Is it as simple as a name, or would more of the code be different?
Alright, question of the century: I did the effect to the rifle, and while that was cool and all... How would I go about making a welder that sets things ablaze (BadlyEngineeredWelder)? Is it as simple as a name, or would more of the code be different?
Brian's code calls predefined functions, so theoretically you should be able to just copy his code and have the Welder call the "set things ablaze" function.
will do a NS2 lua codes contains <summary> in future (on methods especially) ?
it is sometimes very hard to figure out what they doing and on which object can be used ...
also can you point to wiki with tree of LUA classes? I lost link in some point of time
Please Please please document the API in more detail. Explicitly give information about the event hooks. Please explain certain details. As it stands reading your code here Yes i could copy and paste it to make a flaming shotgun I could event potentially add that effect to other weapons but I don't know what all effects I can call. I've tried looking at the source code before and it just turns into the old saying turtles all the way down. It is very difficult for a beginner to grasp. What would benefit the modding coumunity in my opinion is having the API be detailed with examples and information such as what type of thing it can take what the function does what it takes in what it outputs etc.
Nice, managed to apply fire effects to the pistol. Eventually I'll figure out how to increase bullet damage and lower firing speed, and then import a revolver model. :P
Damage is defined in Balance.lua
Incidentally, Balance.lua also has this:
// not used yet
kPistolMinFireDelay = 0.1
thnx for the tutorial, i fiddled around with the lua code in notepad but didnt know how to actualy make it a mod.
and a more in depth programming tutorial would be realy nice too. for example i tried for hours to make my own powernode-lighthandler, but even when i just copy and rename a existing one it didnt work, so i ended up using the lowpower-lighthandler to run my code if the powernode is unsocketed.
Open the UberShotgun.lua file and type the following:
function Shotgun:ApplyBulletGameplayEffects(player, hitEnt, impactPoint, direction, damage, surface, showTracer) if HasMixin(hitEnt, "Fire") then hitEnt:SetOnFire(player, self) end
end
I assume that this is calling various effects functions within the NS2 code?
What I'd like to know is how to find the NS2 code to know where I find these named functions.
Alright, question of the century: I did the effect to the rifle, and while that was cool and all... How would I go about making a welder that sets things ablaze (BadlyEngineeredWelder)? Is it as simple as a name, or would more of the code be different?
Right now, the best option is to just go read the NS2 Lua code. Go find the Welder code and try to figure out how to make it set stuff on fire.
That is how I made the shotgun set stuff on fire. I just read the code and figured out a good place to hook in.
To be honest, a very good understanding of Lua is the first step to code modding NS2. Without that, your journey is going to be much more challenging.
will do a NS2 lua codes contains <summary> in future (on methods especially) ?
it is sometimes very hard to figure out what they doing and on which object can be used ...
also can you point to wiki with tree of LUA classes? I lost link in some point of time
Note: This is horribly out of date. We are working on improving documentation but the game code moves too quickly to document in any decent way. We view the game code as it's own documentation as a result.
I would like if there was more community contribution to the wiki. I have started to add little bits of documentation to it such as http://wiki.unknownworlds.com/ns2/Modding_Framework but it will take more than me to make the wiki work well.
Please Please please document the API in more detail. Explicitly give information about the event hooks. Please explain certain details. As it stands reading your code here Yes i could copy and paste it to make a flaming shotgun I could event potentially add that effect to other weapons but I don't know what all effects I can call. I've tried looking at the source code before and it just turns into the old saying turtles all the way down. It is very difficult for a beginner to grasp. What would benefit the modding coumunity in my opinion is having the API be detailed with examples and information such as what type of thing it can take what the function does what it takes in what it outputs etc.
In short, working on it! It will take a lot of time to get the engine documented as well as we want. If you have suggestions of specific API calls that are confusing, you should post in that thread.
thnx for the tutorial, i fiddled around with the lua code in notepad but didnt know how to actualy make it a mod.
and a more in depth programming tutorial would be realy nice too. for example i tried for hours to make my own powernode-lighthandler, but even when i just copy and rename a existing one it didnt work, so i ended up using the lowpower-lighthandler to run my code if the powernode is unsocketed.
Yes, I will make another tutorial soon covering more advanced code modding techniques soon such as hooking into existing functions, replacing locals in existing functions, how mixins work, etc.
DC_DarklingJoin Date: 2003-07-10Member: 18068Members, Constellation, Squad Five Blue, Squad Five Silver
you may want to do a explenation of how to customise stuff.
It seems counter intuitive (for me) for example to load a mod to edit a weapon viewmodel skin in launcher, only to have to manually load the model itself in the viewer.
Also basic movement in certain programs like zoom, up down etc in like the viewer.
I know you said you're not going to teach lua code here, but just explaining these commands you use would have helped to understand what's going on much much better.
function Shotgun:ApplyBulletGameplayEffects(player, hitEnt, impactPoint, direction, damage, surface, showTracer)
I know you said you're not going to teach lua code here, but just explaining these commands you use would have helped to understand what's going on much much better.
function Shotgun:ApplyBulletGameplayEffects(player, hitEnt, impactPoint, direction, damage, surface, showTracer)
if HasMixin(hitEnt, "Fire") then
hitEnt:SetOnFire(player, self)
end
end
For the rest, lovely post!
Basically, there is a function that is called to do damage and play sound effects when a bullet hits something. I am hooking into this function and checking if the hit target entity (hitEnt) can be set on fire. If so, I set it on fire.
I plan to make another tutorial soon that covered more of how the NS2 gameplay code works and how to hook into it.
So i followed the instructions but for some reason its not switching my text files to lua files and my builder keeps saying "The system cannot find the file specified" for all 4 files. Any ideas?
Comments
Thanks!
For example.. Using a viewmodel skin.
* Do I only need models folder?
* Do I need to use the builder, or am I better of copying it to the output folder?
* I want to change x thing, where do I need to start? Materials? Maps?
Make it as insanely dumb as you possibly can. I always let folk who have no clue test how to's and manuals. If they can do it, anyone can.
(my questions were rhetorical, I dont need a answer to them)
I assume that this is calling various effects functions within the NS2 code?
What I'd like to know is how to find the NS2 code to know where I find these named functions.
This is possibly the greatest idea since sliced bread was invented. WTB Squishpoke revolver mod!
Brian's code calls predefined functions, so theoretically you should be able to just copy his code and have the Welder call the "set things ablaze" function.
Where would have been then the fun ^^
it is sometimes very hard to figure out what they doing and on which object can be used ...
also can you point to wiki with tree of LUA classes? I lost link in some point of time
Incidentally, Balance.lua also has this:
// not used yet
kPistolMinFireDelay = 0.1
and a more in depth programming tutorial would be realy nice too. for example i tried for hours to make my own powernode-lighthandler, but even when i just copy and rename a existing one it didnt work, so i ended up using the lowpower-lighthandler to run my code if the powernode is unsocketed.
Right now, the best option is to just go read the NS2 Lua code. Go find the Welder code and try to figure out how to make it set stuff on fire.
That is how I made the shotgun set stuff on fire. I just read the code and figured out a good place to hook in.
To be honest, a very good understanding of Lua is the first step to code modding NS2. Without that, your journey is going to be much more challenging.
http://wiki.unknownworlds.com/ns2/Lua_class_hierarchy
Note: This is horribly out of date. We are working on improving documentation but the game code moves too quickly to document in any decent way. We view the game code as it's own documentation as a result.
I would like if there was more community contribution to the wiki. I have started to add little bits of documentation to it such as http://wiki.unknownworlds.com/ns2/Modding_Framework but it will take more than me to make the wiki work well.
See http://forums.unknownworlds.com/discussion/130136/api-documentation
In short, working on it! It will take a lot of time to get the engine documented as well as we want. If you have suggestions of specific API calls that are confusing, you should post in that thread.
Yes, I will make another tutorial soon covering more advanced code modding techniques soon such as hooking into existing functions, replacing locals in existing functions, how mixins work, etc.
Thanks for the feedback everyone.
It seems counter intuitive (for me) for example to load a mod to edit a weapon viewmodel skin in launcher, only to have to manually load the model itself in the viewer.
Also basic movement in certain programs like zoom, up down etc in like the viewer.
For the rest, lovely post!
Basically, there is a function that is called to do damage and play sound effects when a bullet hits something. I am hooking into this function and checking if the hit target entity (hitEnt) can be set on fire. If so, I set it on fire.
I plan to make another tutorial soon that covered more of how the NS2 gameplay code works and how to hook into it.