ID:273753
 
how would I make a charge attack system where i hold down a button the attack gains power and when i release it fires the attack with the gained power and doable for different attacks but doesn't use the same formula for the attacks like

ki beam
speed of charge 1x
power gained 1.2x

kamehameha
speed of charge 3x
power gained 4x

you know cause last time i tried to make a system like this it got glitchy cause it kept using the same system allowing you to charge multiple moves at the same time

I kno how to do it macro wise but code wise im not sure accurately how to make it work right

this works great but where would i input the beam system i have 2 different ones on hand but im not sure as to how to input em
In response to Xavion_Zenovka
anyone?
In response to Xavion_Zenovka
Im assuming those beam demos give you a proc in which to "launch the beam"

Simply use the beam demos "launch proc" after the supplied codes activate technique thing

so..

activate_technique()
if(!tech_selected || !charging) return // if you have no technique selected or if you're not charging
hiimthebeamdemo()
usr << "You fire [tech_selected.name] with:\n[tech_selected.charge_speed] Charge Speed\n[tech_selected.power_gain] Power Gain\n\
[tech_selected.damage_power] Damage Power" // send yourself a message giving you the info
tech_selected.damage_power = 0 // reset the techniques damage
charging = 0 // turn "off" the charging var


just fiddle with both codes yourself.. Ideally you want to remake the entire code given by him yourself. Using what he showed you as a basis..

This serves 2 purposes

1. It helps you understand EXACTLY what he did and how he got it working
and
2. Allows you to ensure it fits in nicely with your game.

if you just cut and paste stuff that is given to you.. unfortunately your game will not be very good as if a bug arises you will not know where to begin. So learning the basis of code that someone gives you is a good start..

Even if it takes you ages to understand it.. best to know it before using it ^_^