Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: 0rph3u5 on April 28, 2007, 06:51:19 am
-
For mission I'm trying to create an effect quite like the sensor disturbances you had in Homeworld during the missions against the kadeshi (when you got to sensors manager [the missions map for those who don't know] there were faked red spots and pings everywhere)
I've tried using 30 stationary fighter-size-objects (15 hostile and 15 unknown; with "protect-ship"- and "hidden-from-sensors"-flags) and these little two events down there in the attachment
it does seem to work nicely apart from the fact that after the first envent had been called all of the of the objects apear to in one region and not all over the place like I want them to be
how to I get them to be all over the place?
INFO: the argument lists includes all 30 objects; the rand-multiple is set to work with a range from 10k to -10k
[attachment deleted by admin]
-
I suspect I know what your problem is here.
You've based the mission around (0,0,0) right. So all the numbers range from high positive values to high negative values. The problem is that the random functions don't deal very well with negative numbers. The game figures out what the difference is between the high and low value you entered by doing this.
diff = high - low;
if (diff < 0)
diff = 0;
The game then takes a random number between 0 and the value of diff and adds that the low number. As you can see that calculation will be thrown completely out by the inclusion of negative numbers.
You have two choices.
1) Change
rand-multiple
- -1000
- 1000
into
+
- -1000
- rand-multiple
-- 0
-- 2000
2) Simply pick up and move everything in the mission so your centre point is (1000,1000,1000) or whatever.
-
You've based the mission around (0,0,0) right.
yes, I did...
well now it is 10k,10k,10k and the random functions are ajusted to go from 0 to 20k...
and it works now!
Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!
now I only have to find a solution for a related problem ... but since I know the reason why this is screwing up I will find one
-
I suspect that the problem is just a bug left over from the days when all SEXPs had to have positive values for any number. I'll have to check I wouldn't screw anything up if I fix it.
I vaguely remember that I had a chat with Goober about it last time I poked around the rand functions and he gave me a good reason not to fix it. Could be wrong though.
-
and I hope there will be a time when rand and rand-multiple will accept negative numbers.... and that this might be soon
having only dealing with positive numbers makes rand-stuff less good sometimes (like in another mission where I'm using a derivate of the events aboth.. but these include altering the facing of some objects and if they just face positive coordinates ... well it does not look as good as when the event would go with the full spectrum of coordinates)
(found the solution to related problem...)
-
The problem is a case of 5 seconds to fix, but lots of wondering if I've broken something with the fix. :)
-
The problem is a case of 5 seconds to fix, but lots of wondering if I've broken something with the fix. :)
how about it now, kara?
found the time to to deal with it?
I need the negative random numbers fast
---> I'm about to use a derviate the events for the sensor disturbance to create the obtical effect of Jump corridor collapsing in "WotW - Act 1"'s SOC missions; looks silly if only the upper right half of the corridor fills with *stuff*
-
I can take a look. Can't promise anything yet though.
-
I can take a look. Can't promise anything yet though.
the first date I would need it is the end of june... so no sweat and no hurry