nalesnik
Member-
Content Count
31 -
Joined
-
Last visited
Never -
Medals
Community Reputation
0 NeutralAbout nalesnik
-
Rank
Private First Class
-
A falkland war type senario!
nalesnik replied to Captain Kickass's topic in OFP : MISSION EDITING & SCRIPTING
Over-realistic AK accuracy ? -
Small, pretty straightforward script... unit spying unit just like in old-good bond movies. Come close, move away etc. Perhaps someone will do sth usefull with this. Comments, flames welcome :) --- cut here --- ; [leader, follower, max, min, frequency]exec "scriptname.sqs" ; Comments, flames to Kichu <[email protected]> _leader = _this select 0 _follower = _this select 1 _max = _this select 2 _min = _this select 3 _freq = _this select 4 break = 0 #vrfy ; titleText[ format["RANGE: %1", _follower distance _leader], "plain"] ? (break == 1) : goto "exit_logic" ? (not (alive _follower)) : goto "exit_dead" ? ((_follower distance _leader) > _max) : goto "move_closer" ? ((_follower distance _leader) < _min) : goto "move_farther" ~_freq goto "vrfy" #move_closer _posL = getpos _leader _posF = getpos _follower _Ax = _posL select 0 _Ay = _posL select 1 _Bx = _posF select 0 _By = _posF select 1 _Cx = _Bx + (_Ax - _Bx) / 4 _Cy = _By + (_Ay - _By) / 4 _follower move [_Cx, _Cy] ~3 goto "vrfy" #move_farther _posL = getpos _leader _posF = getpos _follower _Ax = _posL select 0 _Ay = _posL select 1 _Bx = _posF select 0 _By = _posF select 1 _Cx = _Bx - (_Ax - _Bx) _Cy = _By - (_Ay - _By) _follower move [_Cx, _Cy] ~3 goto "vrfy" #exit_dead exit #exit_logic exit --- cut here ---
-
global and local variables
nalesnik replied to nalesnik's topic in OFP : MISSION EDITING & SCRIPTING
OK, got the solution. I was told that all variables are global except those thats name starts with underscore, ie. _x, _y. These are local ones. -
global and local variables
nalesnik replied to nalesnik's topic in OFP : MISSION EDITING & SCRIPTING
Exactly, the script should initialize and export global variable, which name would be passed as parameter. That would make the whole thing 'fire & forget' type. Otherwise you have to mess every time you want to run the thing. -
Ok, the situation is this. I've got a script (unit tracking another unit, not just follow somebody, but like in spy movies, keep the distance between leader, move closer, and farther, depens on situation), that is one big loop. What I need now is generic code to break that loop in any moment (ie. on trigger activations). The coude should work, ie. when I run multiple instances of the tracking script. My idea for now is to have something like this. On exec, you pass as the parameter name of the variable, then the script should do sth like this. The hardest thing is the second line. name = 0; ; HOW TO DO THAT export name as global variable; if name = 1 then goto exit Any hints appreciated
-
Ok, the situation is this. I've got a script (unit tracking another unit, not just follow somebody, but like in spy movies, keep the distance between leader, move closer, and farther, depens on situation), that is one big loop. What I need now is generic code to break that loop in any moment (ie. on trigger activations). The coude should work, ie. when I run multiple instances of the tracking script. My idea for now is to have something like this. On exec, you pass as the parameter name of the variable, then the script should do sth like this. The hardest thing is the second line. name = 0; ; HOW TO DO THAT export name as global variable; if name = 1 then goto exit Any hints appreciated
-
Actually the whole thing isn't hard to code at all as you can see. You just have to know the formula for vector calculations etc. Simple math... which is why Im having these problems... I just dont remeber much... cause it was a long time ago since I learnt these type of things
-
Yes, thats true, but look for the code I wrote till now, so you will see why I didnt want to use the idea I wrote before (a move to getpos b, if distance then b stop). Another loop... nah... Â that would be ugly. --- cut --- #vrfy [....] ? ((_follower distance _leader) > _radius) : goto "move_closer" ~_freq goto "vrfy" #move_closer [...] Ax = _posLeader select 0 Ay = _posLeader select 1 Bx = _posFollower select 0 By = _posFollower select 1 Cx = Ax + (Bx-Ax) / 2 Cy = Ay + (By-Ay) / 2 _follower move [Cx, Cy] ~3 goto "vrfy" --- cut ---
-
Im having the following problems. Lets assume you know the XY coordinates of two units A and B. Is there any way of calucating the X,Y coordinates of waypoint between those units that is no closer than X amount of meters from unit A. Id like to move B into the directon of A, but B should stay at least 100 m away from A. Id prefer not to use the algorithm: B move getpos A if A distance B < 100 then B stop
-
unit tracking another unit
nalesnik replied to nalesnik's topic in OFP : MISSION EDITING & SCRIPTING
Again replying to myself, but I think it's wort to let you know about this "feature". The problem with my script was because of whitespaces in goto labels. The label was "#example " instead of "#example". I've lost 2 hours because of that d*amn thing. If you happen to write: goto "nonexistent_label" goto just hangs the whole script as you would press pause, insted of returning an error or something. And watch out for whitespaces in the labels. You have been warned :-)) -
If anyone would take a look at the problem Id be more than happy. Dont want to put all the stuff in here, but take a look at: <a href="http://www.knm.org.pl/prezes/misc/track.Eden.zip The" target="_blank">http://www.knm.org.pl/prezes/misc/track.Eden.zip The</a> important things are: playable unit (sniper), the grenadier, track.sqs script, and the trigger for executing the track.sqs script. After execution of the script it looks like that the gotos just doesn't work. I put lot of debug print messages and the script just stops after the second one. Theoretically it looks ok for me. If Im doing anything wrong tell me what it is. Thanks
-
Indeed, that this would be a real blast for (not only this) mission... as the mood is one of the main 'objectives' in writing this mission. Unfortunately theres a big difference between reading and hearing all those radio chat As for the 'ssshttt' wav, I think I'll just decompress one of the pbo voice files from opf, then try to find and edit the appropriate files. From what I noticed it's used on every single radio chat in opf. I'll let you know of my results.
-
Just a thought. I think the problem is with the briefing... lack of it to be exact. It should be more obvious when I do that part of the mission. As for now, I've changed it a little. Take a look if interested, the url is the same (just replaced the file). FYI, the other part of the mission (after the forest thing) is to locate Cuba (who travels in bmp between two locations and sometimes get out of the vehicle for amount of time). When you complete this objective (radio msg 0-0-1) you'll receive the orders to kill him and the go to the evac point. Im also thinking about coding one more thing ie. from some point you'll be followed by another russian sniper team (300-400 metres, with hold fire orders). But thats just an idea at the moment, nothing more. Btw, any ideas where do I find a realistic wav with the radio communication "ssshhht" after end of the msg. The one I use is not my favourite.
-
You wrote: "Then I moved about, trying to locate those so much talked about enemy snipers, didn´t see a thing. Was bored, emptied a clip because I thought they were not nearby anyway." And thats the hardest things about doing this mission. Timing the event, so the player didnt just go out of the forest, but stayed there and engage with the enemy. Part of the floks that played it when found nothing in camp, just went out of the forest with no enemy contact (didnt care about all the dragunov shooting etc.), part played just a I planned the thing. Btw, I assume that you found the camp (you saw the debug msg, right?) Let me know tell you how its organized. When you are close enough to the camp I move the enemy sniper team (sniper with speznac, mirror image of your team) in one of the predefined locations (15 of them) about 130-150 m from the camp. They start to move into the camp in aware mode and sniper shoots a couple of times, so you know he's still there. When they're at about 80 m from the camp, the specnaz starts to run into the camp, snipers goes low and starts to crawl into the location. Spetz is first, wait for snipe, then they both continue to patrol the area nearby the camp. A neat ambush for player who is going to stay and observer camp, and kills the spetznas, thus showing his location to the other guy. The thing is that I dont want to move the enemy team closer than 130-150 m, as this gives you no time to react, and you're almost set up from the begginnig. But the road from some of those locations can take a little bit of time, so part of the players just goes away from the camp, and won't experience the whole event. Any ideas ? :-) As for translation, sure, but now Id like to polish this part of the mission.
-
autocorrection, the url was missing a '-' http://www.knm.org.pl/prezes/misc/C-10-Cuba.Eden.pbo in case of problems just go to /prezes/misc/ directory and then choose the file