Home   Help Search Login Register  

Author Topic: init.sqs  (Read 3132 times)

0 Members and 4 Guests are viewing this topic.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
init.sqs
« on: 19 Jun 2007, 16:06:08 »
It seems that init.sqs isn't as fool proof in ArmA as it used to be in OFP, or am I imagining things? I did the following tests in init.sqs
Code: [Select]
hint "Test if init.sqs is working or not"I added that line to my init.sqs and started the mission several times. In 8 tries out of 20 the hint wasn't shown at startup. Has anyone else noticed that init.sqs is more unreliable then it used to be in the good old days?

EDIT: And while I'm on the subject... are all the other event based scripts that came with OFP still functioning the way they used to?
« Last Edit: 19 Jun 2007, 16:08:40 by nominesine »
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: init.sqs
« Reply #1 on: 19 Jun 2007, 18:13:48 »
Strange, maybe add a delay ~5 or something to give it time to kick in?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: init.sqs
« Reply #2 on: 19 Jun 2007, 18:26:14 »
Well, as far as I know any hint needs display number 46 (ArmA main screen) to be created and present. In init.sqs if you try _disp = findDisplay 46 as first line the return will be null all the times, your 8 hints out of 20 is a miracle :P

I agree with Lee, sleep a second first and then execute your hint.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: init.sqs
« Reply #3 on: 19 Jun 2007, 21:42:18 »
The init is okay, but when it gets executed is variable, which is why your hint will not display all the time. A pause(of any time length) in your init will make it wait until the mission is actually started before executing the hint. In any event, the init is not the place for that. Call another script from your init, and put a small pause at the top of that script, then have your hint command.
urp!

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: init.sqs
« Reply #4 on: 20 Jun 2007, 00:42:16 »
Just to clarify...

The problem i not really that I cannot add a hint command to the init.sqs. The real problem was a camerascripts that I wanted to execute right at the beginning from the init.sqs, using the following syntax:
Code: [Select]
[] exec "film.sqs"Sometimes it worked, sometimes it didn't. I threw in the hint for testing purposes only. The camerascript needs to be launched directly, hence a delay of ~00000.1 or whatever will not work. I can make a workaround and execute the script from the initline of the player unit. Though I would still prefer to find out if the init.sqs is reliable or not. Maybe it's a Windows Vista problem? If anyone can shed some light upon this matter I'd be grateful.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re: init.sqs
« Reply #5 on: 20 Jun 2007, 01:08:33 »
Hi nominesine

I don't know if this works in ArmA or helps in your situation but I did this in a mission I made for OFP: I put a condition to wait until an airbourne vehicle had started moving and only then I let the script continue.

The check I used was:

Code: [Select]
@(speed BDO_uav > 0)
The reason I needed this was that I started a cutscene script from an initialization field of a UAV and I had a disableUserInput true in there... if I didn't put some conditional check into it then the user input was disabled for the briefing  :clap:

I think I had the conditional check in the init.sqs file too at some point in development and it worked okay from there too.

It worked fine in OFP. The UAV set to "flying" only starts to move after the briefing is over and the mission is started. The cutscene is showing view from the UAV right at the start of the mission and it worked perfectly. Maybe you can do something similar.

Best Regards,
Baddo.
« Last Edit: 20 Jun 2007, 01:20:59 by Baddo »

Offline WhisperOFP

  • Members
  • *
  • I'm a llama!
Re: init.sqs
« Reply #6 on: 20 Jun 2007, 12:32:06 »
Sorry to interfere, but isn't init.sqf/init.sqs launched during the mission briefing? In which case, you'd need to wait a bit more before launching the cutscene, wouldn't you?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: init.sqs
« Reply #7 on: 20 Jun 2007, 12:44:25 »
Nope, init.sqs is launched when mission starts.

Investigation: Initialisation of units/objects/waypoints/triggers

Nominesine, so far init.sqs has been always reliable for me (including camera creation at the very beginning of init.sqs). Are you sure your camera script is 100% innocent of that problem?


Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: init.sqs
« Reply #8 on: 20 Jun 2007, 17:43:00 »
If the init.sqs file is launched when the mission starts, then how come things like objectives for the breifing when you want to hide them work from using objstatus in the init.sqs.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: init.sqs
« Reply #9 on: 20 Jun 2007, 18:03:15 »
May be init.sqs is parsed first just looking for objStatus commands there.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: init.sqs
« Reply #10 on: 20 Jun 2007, 18:54:09 »
From that old article:
Quote
Init.sqs without a delay will be finished before starting the game in every case.
i.e. the init starts right after passing the slot selection screen and, supposedly, will always finish before the mission starts. A pause will halt script execution until the mission starts. So script out what you are doing and put a small pause at the top of that script. That way your init will continue to process, while your cam script waits.
« Last Edit: 21 Jun 2007, 15:37:45 by Mr.Peanut »
urp!

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: init.sqs
« Reply #11 on: 21 Jun 2007, 15:24:15 »
Are you sure your camera script is 100% innocent of that problem?

Yes I am. I think the failure to execute the simple hint command proves that it is not the scripting, its the init that causes the problem. I am, however, uncertain if this is fault of the game engine or my operating system (I installed Vista on my new computer, wich I sincerely regret).
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: init.sqs
« Reply #12 on: 21 Jun 2007, 16:08:23 »
1) Remove all pauses from your init
2) Place a 0.5 pause at the very top of each script that requires it, your cam script in particular

This does not fix the problem?

Yes, installing Vista was a mistake as far as ArmA. Bi has officially stated that ArmA does not support Vista.
urp!

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: init.sqs
« Reply #13 on: 21 Jun 2007, 21:06:01 »
Yes, installing Vista was a mistake as far as ArmA. Bi has officially stated that ArmA does not support Vista.

I know  >:( But it least it was cheap  :P

I installed ArmA on my old compuiter, just to check what happened in XP. It worked like a charm (but ArmA is extremely laggy on my old computer). Maybe it's a hardwareproblem rather than an editing problem?!? That's a relief to me, because then I just have to wait for a better Windows Patch. I don't have very much time for scripting anymore, so Vista will probably be upgraded several times before I have anything ready for release  :D
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: init.sqs
« Reply #14 on: 21 Jun 2007, 22:20:09 »
May be you can do a dual boot Vista/Xp in your Vista computer.