Home   Help Search Login Register  

Author Topic: Do not allow X speed for duration of a script  (Read 1412 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Do not allow X speed for duration of a script
« on: 08 Jan 2009, 18:46:38 »
How can I stop the player being able speed up time during a script?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Deadfast

  • Members
  • *
Re: Do not allow X speed for duration of a script
« Reply #1 on: 08 Jan 2009, 19:56:55 »
Perhaps there's a better way, but you could simply run a loop checking if accTime != 1 and if so setting it to 1

Code: [Select]
while {scriptOn} do
{
if (accTime != 1) then
{
setAccTime 1;
};

sleep 0.5;
};

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Do not allow X speed for duration of a script
« Reply #2 on: 08 Jan 2009, 21:00:05 »
Sorry to be a pain but how would I do this in a .sqs?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Deadfast

  • Members
  • *
Re: Do not allow X speed for duration of a script
« Reply #3 on: 08 Jan 2009, 22:42:38 »
I suck at SQS, but this seems to work :D

Code: [Select]
#loop

? accTime != 1 : setAccTime 1;

~0.5

? scriptOn : goto "loop"

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: Do not allow X speed for duration of a script
« Reply #4 on: 09 Jan 2009, 06:08:04 »
Arch, just curious but why would you want to implement this with SQS? SQF (functions) perform much better than SQS when executing something at rapid intervals. So your mission would have better performance running this script as an SQF than and SQS.

Im sure for most the difference would be negligible, but it might not be transparent to some.
Just my 2 cents worth.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Do not allow X speed for duration of a script
« Reply #5 on: 09 Jan 2009, 10:49:57 »
I've not learned all the syntax for .sqf. At least with .sqs I kind of know where I am.
You know how it is, when you're flying through a particular point with a project you don't want to stop and learn a whole new thing. If there's an easy way you'll take it.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Do not allow X speed for duration of a script
« Reply #6 on: 09 Jan 2009, 15:10:05 »
The path of least resistance :)
Xbox Rocks

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Do not allow X speed for duration of a script
« Reply #7 on: 09 Jan 2009, 15:37:21 »
Unfortunately, the path of least resistance all too often ends abruptly in a 400ft waterfall with big pointy rocks below. If ArmAII goes .sqf-only, your .sqs barrel will not survive the drop.

It's really not that much more to learn at all.

Offline Ext3rmin4tor

  • Members
  • *
Re: Do not allow X speed for duration of a script
« Reply #8 on: 09 Jan 2009, 15:55:17 »
He's right, I spent 3 days to learn SQF syntax, it's worth your time. The control structures allow you to make a good code and not that "spaghetti code" shit you have to do with goto's in SQS. Besides as he said, ArmA2 will be propbably SQF only
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Do not allow X speed for duration of a script
« Reply #9 on: 09 Jan 2009, 16:02:53 »
I agree also, mostly the main differences are just the looping functions all other commands really remain the same.
Xbox Rocks