Jump to content

Code for throwing fireball


Recommended Posts

I have little to no experience in programming and was hoping for some help with a specific ability for my custom character. I want him to be able to pretty much have the same effect as a fire staff without the need of equipping the staff to do so. I am not sure where any of the code would go either, so I apologize for my high level of ignorance here. Any help at all would be much appreciated.  

  

EDIT: Having the ability like the Deadpool character mod, where his weapon shoots fireballs in essence, would be great too. 

Edited by neal_b4_me
Link to comment
Share on other sites

Without providing code, each character has it's own file that highlights custom functionality,

Where to place my code:

Generally a pointer:

your character should have a named file in there should be a list of functions, try to find "master_postinit".

Code for character functionality is usually stored "server side" so it is included in the "master_postinit" as opposed to "common_postinit" which is both server and client; you don't have to worry too much about this however.

Think of master_postinit as your main function that lets you attach the important functions that work as part of your character.

Components:

Components are usually existing systems of functionality that allow characters to utilise specific pre-existing code structures that reflect abilities or capabilities.

Generalised approach:

First you need to consider how the combat system/component for unarmed combat. Every character shares common features that the player_common.lua file contains, in here you will find the line ":AddComponent("combat")" which I gather deals with unarmed combat based on the line ".combat:SetDefaultDamage(TUNING.UNARMED_DAMAGE)".

You maybe able to manipulate the combat system to work like a weapon or you could attempt to set it so your character always defaults to using a custom weapon without equipment (unsure how this might be supported), I assume you've already found the staff file and see the components that a fire staff would use. You maybe able to test if you can straight up add the weapon code to the character with the component or possibly overwrite the combat system to act as though it were the fire staff instead.

Further lua support - ( of which I myself also find handy)

Coding isn't too bad to get into, but it often helps to have a platform to stress test logic and reinforce knowledge through testing(which is how I go about many different languages).

If you'd like to master the syntax there are plenty of tutorials on lua, I'd say that even I get relatively confused when it comes to meta tables though (but they are often used in specific circumstances that most modders don't need to worry about).

Try SciTE for testing theoretic code out, it's what I use: http://www.scintilla.org/SciTEDownload.html (download the respective "executable" version).

All this might hopefully may help you hone in on implementing it if you're stuck atm.

Edited by MorickClive
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...