Update: Weapons in!… now to make them shoot. These are now what is equipped.
Now to getting the lead and shells flying!
(click image for larger as always)
This is more fun for sure then user interface monotony. I am going to think out loud on the blog here.
All weapons,skills,usable items will have 3 stages.
1. Start (Press button)
2. Charge (hold button)
3. Fire (release button)
These will be handled via scripts. These scripts will do different things based on what they are. A energy weapon will charge while holding while a machine gun will fire continuously. A grenade will build throwing distance ( O and I am so happy to have a better physics system then I had in ME 1 sooooo Happy…).
Item Mods have weapon effects. They have Start,Charge,Fire
All mods are activated if they have a script
Script design:
Player Controller (Left Fire,Right Fire, Dual Fire buttons)
Player presses Right Fire The weapons script for the right handed weapon is called Start. (Weapon Script = WS)
(Example Plasma Gun):
Start – Mod[1] Has a WS on start it says spark at the end of the barrel.
At the end of the barrel is a transform for location called muzzle on all weapons (they also have an eject transform for ejecting shells). It is where the effects are.
Swords have one at the tip and bas of the sword and bottom of the hilt (same for all melee).
Now while player is charging the script is told it is charging. On this weapon it increases an effect to full power over whatever time it takes.
The player release the button and fire is called. A plasma ball is emitted from the muzzle location and sent into the world.
The plasma ball has a callback on hit for effect. Detect if it hit an AI if so then use Combat Script to do damage based on the weapons stats plus the players stats.
—————————
Example: Saw Machine Gun
Player presses Right Fire:
Weapons Script start has nothing.
Charge:
While holding emit a bullet every X time with a script attached.
Fire: stop firing
When bullet hits do the same with combat as above.
————————–
Off to work!