OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Rommel92 on 29 Mar 2008, 15:58:04

Title: ROMM_fRecordPos (ACCEPTED)
Post by: Rommel92 on 29 Mar 2008, 15:58:04
Rommels fRecordPos
Version 105 by Rommel

Aim: To create a script that allows the output of positions rather then manually re-writing them out via a hint after multiple recordings..

TAGGED GLOBAL VARIABLES - SQF Optimized

Preview Mission Included, feel free to edit, keep base credits if possible please, otherwise its open source and go insane.  :)

Version 105 released.

Get fRecordPos v1.05 (http://www.ofpec.com/ed_depot/index.php?action=details&id=548&page=0&cat=xyz)
Title: Re: Positions Recorder
Post by: Spooner on 30 Mar 2008, 00:07:41
Erm, you are using exec to run a script with the .SQF extension. This command will only run SQS syntax scripts. The script itself would work in both SQS or SQF since it is pretty simple, but using exec might confuse yourself and other people if "real" SQF syntax was used in the file. Either:
* rename it as a .sqs file
* use "execVM" or "call compile preprocessFileLineNumbers" to run the file if you really intended it to be SQF.
Title: Re: Positions Recorder
Post by: Rommel92 on 30 Mar 2008, 01:47:41
Haha... ehh woops...  :P (Fixed)
Old habits you know...

EDIT (Spooner): you don't need to quote the previous post in its entirety.
Title: Re: Positions Recorder
Post by: johnnyboy on 27 Apr 2008, 22:44:41
Thanks Rommel. I've been doing this by hand for friggin ever.  Good on ya, as u down under dudes say.
Title: Re: Positions Recorder (READY)
Post by: Mandoble on 30 Apr 2008, 18:42:03
record.sqf and play.sqf scripts are missing. Dialog controls are missing parameters. I suppose you comminted some mistake with file attachment because that file is in no way ready for any submission.
Title: Re: Positions Recorder (NOT READY)
Post by: Rommel92 on 30 Apr 2008, 20:13:43
Whoa... I don't know what happened when I submitted that file, must've been on drugs or something...  :blink:
Thanks for pointing these out Mando, all fixed now, sorry for the inconvience...

Title: Re: Positions Recorder (NOT READY)
Post by: Mandoble on 30 Apr 2008, 20:17:29
Ok, but lets not fill up the thread with different attachments, as first one is still wrong. Please, remove the previous attachment and fix the one at the first post.

EDIT:
Also include one of these (or both):
- Clear instructions and version in scripts header
- A readme with the instructions and versions.
Title: Re: Positions Recorder (NOT READY)
Post by: Rommel92 on 30 Apr 2008, 20:30:16
Included a header containing execution and notes on the script for easier understanding of others.
- Removed second attachment.
- Updated 102.
- Added TAG to mission pre-fix.
Title: Re: Positions Recorder (NOT READY)
Post by: Mandoble on 30 Apr 2008, 20:47:43
Ok, now it is error free, but:
- Your script is still named script.sqf, not ROMM_recordPos102.sqf or ROMM_recordPos.sqf.
- Add a hint in the init.sqf explaining what to do (select this radio to get the current postion, select the other to copy/paste the positions array).
- Consider that you are always getting the position of the player, even if the player is inside a vehicle. And position of the player inside a vehicle is not equal to the vehicle position. You might consider to use getPos vehicle player for all the cases.
- For your demo purposes, it would be far more handy to use menu actions than radio calls.
- In the demo, there where the player gets a position, you should hint or title text something ("Current position recorded", for example).
- You might consider to add an option to really turn recording ON, and a small dialog to enter the number of seconds to wait before next recording and maximum number of positions to be recorded, and also an option to turn automatic recording off. When maximum number is reached, recording would be automatically turned off.
- If you do the above, then you need a different strategy to print the positions as current system will print too many decimals (specially for the Z), and EDIT control buffer is limited, so you should aim to print only a single decimal per each X, Y, Z

Code: [Select]
_msg = "";
{
   _msg = _msg + format["[%1,%2,%3],", floor( (_x select 0)*10)/10,floor( (_x select 1)*10)/10,floor( (_x select 2)*10)/10];
} forEach vpos;
ctrlSetText[_debug, _msg];

Title: Re: Positions Recorder (NOT READY)
Post by: Rommel92 on 30 Apr 2008, 22:31:00
Your method of _msg doesn't seem to work, heres the latest version (will remove after you had a look at it), I didn't want to have a timed recording, because if they want something more methodical, its (1) easy to implement and (2) you can just push the action multiple times, more precise too.

 :good:
Title: Re: Positions Recorder (NOT READY)
Post by: Mandoble on 01 May 2008, 12:58:26
This works fine for me:
Code: [Select]
/*
 version: 1.03;
 author: rommel;
 execution: nil = [player] execVM "script.sqf" or "ROMM_action_PosRecord = player addaction ["Record Current

Position","ROMM_recordPos.sqf"];
 notes: this script calls the editable dialog containing all the recording coordinates stored in a global variable,
as indictated by: ctrlSetText[_debug, format["%1", _editablemessage]];
*/

_debug = 2400;
createDialog "ROMM_PosRec_dialog";
_msg = "";
{
   _msg = _msg + format["[%1,%2,%3],", floor((_x select 0)*10)/10,floor((_x select 1)*10)/10,floor((_x select 2)*10)/10];
} forEach ROMM_PosRec_array;
ctrlSetText[_debug, _msg];

Also, in ROMM_recordPos.sqf hint, change the /n by \n.

You might also consider to store also the direction, something like [[position array, direction],[position array, direction], ...] or two arrays one for positions and other for directions and then add a second edit box to your dialog to show also the directions.

Title: Re: Positions Recorder (READY)
Post by: trooper.ryan on 14 May 2008, 14:07:27
I'm modifying Rommel's good work here - but cannot figure out how to get the dialogue box to use newlines.

\n in _msg isn't interpretted as a newline char, any ideas?

Title: Re: Positions Recorder (READY)
Post by: Rommel92 on 15 May 2008, 10:00:15
It probably comes out as a string, and isn't interpreted as code, not entirely sure, never been a lover of strings, but perhaps you may have to join two strings together in the _msg and have a /n in between.

 :)
Title: Re: Positions Recorder (READY)
Post by: Rommel92 on 26 May 2008, 15:04:43
Updated to v105;
Check first post for extended information.
Title: Re: ROMM_fRecordPos
Post by: Mandoble on 26 May 2008, 21:22:08
I get the recorded Current Position/Direction message, but Im only able to get the positions, not the directions.
Title: Re: ROMM_fRecordPos
Post by: Rommel92 on 27 May 2008, 00:42:27
So sorry mate, damnit. That was a test on whether it should record, and out of simplicity I left it as is. (Fixed .rar file)
Title: Re: ROMM_fRecordPos (ACCEPTED)
Post by: Mandoble on 01 Jun 2008, 11:28:36
Added weaponDirs recording, fixed all the script headers and accepted.
Title: Re: ROMM_fRecordPos (ACCEPTED)
Post by: Jackal on 03 Dec 2008, 10:06:45
Rommel, thanks for the resource. Duke mentioned this script to me and I soiled myself with excitement. Trying it out now. This should save loads of time "setpos"ing 30 guys in cool attack positions and doing the million previews to tweak them just right.  Good work, laddie.  :good:
Title: Re: ROMM_fRecordPos (ACCEPTED)
Post by: Rommel92 on 06 Nov 2009, 02:03:00
Anyone know where this went, I wanted to make a new one for ArmA but save on re-making the dialog. Theres a broken link and the attachments are gone.
I'm going to assume there's no easy fix to that, so I'll just have to re-write it.

cheers,

Romm