Jump to content

Math Functions In Scripts


Corejob

Recommended Posts

Need some help.

 

I am working on a burst fire addition to my select fire script. My idea is to read the weapon rate of fire, and have the option for a 4 digit rate of fire in the form CBAA where AA is the real rate of fire. B is either 0 or 1 indication whether the weapon supports semi and burst or semi, burst and auto (burst fire is implied with a retrieved ROF of >99) and c represent the number of round per burst.

 

Thus, if someone calls my SelectFire script and the given weapon has an ROF of 4012, the weapon has the burst option, the rate of fire is 12, the weapon supports semi and burst, and it fires 4 rounds per burst.

 

The question is does the scripting feature support typical math operators like INT so break the for digit value into their respective settings;

 

e.g.

 

if ROF is > 99 weapon is burst

set RoundsInBurst to INT(ROF/1000)

set ThreeMode to INT((ROF - (RoundsInBurst * 100))/100)

set RealROF to ROF - (RundsInBurst*1000) - (ThreeMode*100)

else

weapon is semi and auto

 

Thoughts?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...