• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

WE: can you change decimal precision ?

Status
Not open for further replies.
Level 8
Joined
May 21, 2019
Messages
435
Hello,

The question may be dummy, but I still would like to know the answer:

In WE (GUI), reals are saved with 2 decimals (1.123456 is saved as "1.12"). Is it possible to change the number of decimals, to increase precision ? For example with 4 it would save "1.1234" instead :)

Sincerely,

Ricola3D

I'm not aware of a direct way to do this, but you could store the value as a string, and then use the substring methods to fetch the decimals for further math.
 
Level 39
Joined
Feb 27, 2007
Messages
5,036
I think that l4h thread is far above what the OP is asking about. Using a string as Cespie suggested is probably the simplest, but you don’t actually need to use substring. Just use Convert String to Real directly everywhere you need to specify additional precision. It will look like:

Time - Every (Real(“0.025”)) seconds of game time

I would suggest, however, that you not do a massive amount of such conversions at once if you need to use the number multiple times. Instead store it in a variable and reference the variable.

  • Set RealTemp = (Real(“1.23456”))
  • Unit Group - Pick every unit in...
    • Loop
      • Unit - Cause UNITA to damage Picked Unit for RealTemp points...[/realtemp]
 
Status
Not open for further replies.
Top