Author Topic: Script Error  (Read 3471 times)

Mihhaelo

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 67
Script Error
« on: April 07, 2010, 02:38:44 AM »
Hi again, i've never really scripted before so i'm not sure what i am doing wrong. The following piece of code appears to work and does what i want it to in game, but causes eufloria to crash after what appears to be random lengths of time. Sometimes the game will last 30 seconds, sometimes 10 minutes. Could someone have a look and let me know what's wrong? thanks.

(click to show/hide)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Script Error
« Reply #1 on: April 07, 2010, 06:43:08 AM »
Can you describe the effect this code has ingame?  :>

Mihhaelo

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 67
Re: Script Error
« Reply #2 on: April 07, 2010, 08:48:13 AM »
I have no idea what was happening.

One early theory was that the second part of the bottom line was being erroneously rounded up on rare occasions leading to a negative SendDistance value. Although when i tested it, i discovered that the game is infact perfectly fine with negative SendDistance values.

Changing the second 1500 to 1499, fixed the crashes. Strange.

The code scans through the planets on the map, and then changes the distance they can send seedlings based on the day/night cycle (Plants need sunlight!) and how many plants are currently on the planet.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Script Error
« Reply #3 on: April 07, 2010, 03:56:31 PM »
What was the purpose of including math.rad?  ie why do you need the time in radians?
Not sure what was wrong really.