Home   Help Search Login Register  

Author Topic: ROMM_fRecordPos (ACCEPTED)  (Read 6317 times)

0 Members and 1 Guest are viewing this topic.

Offline Rommel92

  • Members
  • *
ROMM_fRecordPos (ACCEPTED)
« 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
« Last Edit: 01 Jun 2008, 11:27:36 by Mandoble »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Positions Recorder
« Reply #1 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.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Rommel92

  • Members
  • *
Re: Positions Recorder
« Reply #2 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.
« Last Edit: 30 Mar 2008, 17:44:10 by Spooner »

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Positions Recorder
« Reply #3 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.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Positions Recorder (READY)
« Reply #4 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.

Offline Rommel92

  • Members
  • *
Re: Positions Recorder (NOT READY)
« Reply #5 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...

« Last Edit: 30 Apr 2008, 20:22:43 by Rommel92 »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Positions Recorder (NOT READY)
« Reply #6 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.

Offline Rommel92

  • Members
  • *
Re: Positions Recorder (NOT READY)
« Reply #7 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.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Positions Recorder (NOT READY)
« Reply #8 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];


Offline Rommel92

  • Members
  • *
Re: Positions Recorder (NOT READY)
« Reply #9 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:
« Last Edit: 01 Jun 2008, 11:28:00 by Mandoble »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Positions Recorder (NOT READY)
« Reply #10 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.


Offline trooper.ryan

  • Members
  • *
Re: Positions Recorder (READY)
« Reply #11 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?


Offline Rommel92

  • Members
  • *
Re: Positions Recorder (READY)
« Reply #12 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.

 :)

Offline Rommel92

  • Members
  • *
Re: Positions Recorder (READY)
« Reply #13 on: 26 May 2008, 15:04:43 »
Updated to v105;
Check first post for extended information.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: ROMM_fRecordPos
« Reply #14 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.