1.

Solve : Help On Health/Damage Calculation?

Answer»

Basically i have this:
Code: [Select]IF %AS1%==Charge (
SET %ECHP%=%ESHP%*%ECS%*%ECF%/3-10
) ELSE (
IF %AS1%==Distract (
set %ECF%=%ESF%-5
)
)
For some reason it doesn't work, i think it is because of this calculation:
Code: [Select]set %ECHP%=%ESHP%*%ECS%*%ECF%/3-10
I am not too sure how to do +,-,* and / in MS-DOS/Batch.
Any help is appreciated.

All of them are declared correctly.
set ECHP=Example
and so on..Quote from: Dias de verano on June 26, 2008, 12:01:02 PM

Quote from: Jacob on June 26, 2008, 11:29:13 AM
Basically i have this:
Code: [Select]IF %AS1%==Charge (
set %ECHP%=%ESHP%*%ECS%*%ECF%/3-10
) ELSE (
IF %AS1%==Distract (
set %ECF%=%ESF%-5
)
)
For some reason it doesn't work, i think it is because of this calculation:
Code: [Select]set %ECHP%=%ESHP%*%ECS%*%ECF%/3-10
I am not too sure how to do +,-,* and / in MS-DOS/Batch.
Any help is appreciated.

All of them are declared correctly.
set ECHP=Example
and so on..

Really?

Quote
IF %AS1%==Charge

What exactly is "Charge"?

Is it a literal string or a variable? Or SOMETHING else?


Are these MEANT to be arithmetic operations?

Quote
set %ECHP%=%ESHP%*%ECS%*%ECF%/3-10

Quote
set %ECF%=%ESF%-5


Charge is just an attack style
and yes those ones are meant to be mathematical sums.Quote from: Jacob on June 26, 2008, 11:29:13 AM
I am not too sure how to do +,-,* and / in MS-DOS/Batch.

You have to use set with the /a switch to do calculations. A is for Arithmetic.

set /a sum=%NUMBER1%+%number2%


That works, thanks, but what to i do if i want to 'goto dead' if %ECHP% is less than or equal to 0.
Thank you.Quote from: Jacob on June 26, 2008, 12:29:11 PM
That works, thanks, but what to i do if i want to 'goto dead' if %ECHP% is less than or equal to 0.
Thank you.

if %ECHP% LEQ 0 goto dead

It's all in the IF help, which you can access by typing IF /? at the prompt.
Thank you, i have no finished my basic battle/fighting ENGINE.


Discussion

No Comment Found