Jump to content

Recommended Posts

Hello. I have a problem. I made a script, which changes smoothly the wind. It's works, there are no problems. Here is that script: (I know it's SQS, but it was easier to write :D)

 

;SCRIPT BY JTS

params ["_value","_coef","_delay"]
private "_changeX";

?(!isServer): exit

?(!isNil "wndChanger"): exit
wndChanger = true

_changeX = false

#Check
_windValueX = abs (wind #0)
_windValueY = abs (wind #1)

?(_changeX): goto "ProcessY"


#ProcessX
?(_windValueX < _value): _wX = (wind #0) + _coef;_isPlus = true
?(_windValueX > _value): _wX = (wind #0) - _coef;_isPlus = false

setWind [abs _wX, (wind #1), true]
~_delay
_windValueX = abs (wind #0)
_windValueY = abs (wind #1)
if (_isPlus) then {if (_windValueX >= _value) then {_ChangeX = true}} else {if (_windValueX <= _value) then {_ChangeX = true}}
goto "Check"



#ProcessY
?(_windValueY < _value): _wY = (wind #1) + _coef;_isPlus = true
?(_windValueY > _value): _wY = (wind #1) - _coef;_isPlus = false

setWind [(wind #0), abs _wY, true]
~_delay
_windValueX = abs (wind #0)
_windValueY = abs (wind #1)
if (_isPlus) then {if (_windValueY >= _value) then {goto "CHANGED"}} else {if (_windValueY <= _value) then {goto "CHANGED"}}
goto "Check"


#CHANGED
systemChat "WIND CHANGED"
wndChanger = nil
exit

 

There are problem when you save the game. Following (Happens in SP (Not eden editor). In MP I'll test if it works in SP):

You save the game with autosave or with "Exit and save" button (not sure how its correct name on english). You then load the game from screnario list pressing the 'Continue' button. Then there are 2 situations that happens:

1. Loaded from save while script is running:

- Wind values goes crazy and are changing very quickly to -100 or + 100

- There is no way to change the values even with setWind command. It doesn't work. Wind just changes to -100 or +100

 

 

2. Loaded from save when script is not running:

- No problems at this moment. But as soon you start to change wind with setWind command - it goes crazy and changes very quickly like I said to -100 or +100. Sometimes it stuck on very low values like 8, 10. But not both values. It's x or y.

 

I don't any idea why that happens. I also use my script to change the weather (overcast, rain).

 

> Overcast is changed with simulWeatherSync command
> timeMultiplier is also set to 10 (Tested it now. This is not a reason for that bug)

> Bug happens if you load the game more than 2 or 3 times. But sometimes even on first load

> Example: [8, 0.05, 0.2] exec "WindChanger.sqs"

> For some reason this bug doesn't happen in editor

> The bug doesn't appear when I closed the game, started it again and loaded from save

Share this post


Link to post
Share on other sites

You stated it yourself...... You are using... Wait for it....  SQS!

Rewrite it in SQF.

  • Like 1

Share this post


Link to post
Share on other sites

This have nothing to do with SQS. Sorry, but your comment is incompetent

Share this post


Link to post
Share on other sites
On 1/1/2020 at 6:51 PM, jts_2009 said:

2. Loaded from save when script is not running:

SQS aside, have you tried Manual Override on the editor?

 

38FaVq3.jpg

Share this post


Link to post
Share on other sites

Sure. Otherwise I couldn't change it. It looks like that when you quit mission, its 'cache' or data or however it called - probably stuck in some memory. Like I said in first post - if you close the game and continue the mission, the bug doesn't appear after game is loaded. Probably it's just an arma 3 bug

Share this post


Link to post
Share on other sites
2 hours ago, jts_2009 said:

if you close the game and continue the mission, the bug doesn't appear after game is loaded.

 

Hello there jts_2009 !

 

I'm not sure about your problem , but try this example to see if it's going to work :

 

ex:

addMissionEventHandler ["Loaded", {
	params ["_saveType"];
	
	If(_saveType isEqualto "continue") then{
		[] execVM "GF_Earplugs\GF_Earplugs.sqf";
	};
}];

[] execVM "GF_Earplugs\GF_Earplugs.sqf";

 

  • Like 1

Share this post


Link to post
Share on other sites
23 hours ago, GEORGE FLOROS GR said:

I'm not sure about your problem , but try this example to see if it's going to work :

 

I don't see a reason why it should not work 🙂

 

The bug seems to be appear on Chernarus. Im making a coop on chernarus. I tested the wind on Stratis and there was no problems. Looks like it happens on cup terrains (currently only chernarus tested)

  • Haha 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×