Home   Help Search Login Register  

Author Topic: Any idea  (Read 1199 times)

0 Members and 1 Guest are viewing this topic.

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Any idea
« on: 15 Aug 2007, 07:33:07 »
Okay, I've got a little idea. But I'll need some help with it. It's regarding .sqs files and setpos.

Okay, so just to get this over and done with. If I put in a mission editor script in an .sqs file, and execute it in-game, will it work properly? Is there any hotkey to activate the script? So rather than entering a trigger that executes the .sqs, you could press a key like = or whatever. I could do this in the editor without an .sqs but I'm working on a secret project... lol.

Also, what if in my .sqs I had something like John moveindriver Jeep? Is there some way the game can detect the player's mission editor name and add that in instead of John? Thanks.

Chris :)
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Any idea
« Reply #1 on: 15 Aug 2007, 12:19:45 »
You may use addAction command to attach actions for any unit, vehicle or object.
For example, in the init field of the player:
Code: [Select]
this addAction ["My script", "myscript.sqs"]
and then, for myscript.sqs
Code: [Select]
hint format["My name is %1", name player]

You may use also radio triggers to execute action, just set the trigger activation to radio Alpha, Bravo ... put the exec of your script into its activation field. Dont forget to mark the trigger as "continuos" checks, so your dont lose your radio action after the first use.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: Any idea
« Reply #2 on: 16 Aug 2007, 16:38:09 »
Quote
Also, what if in my .sqs I had something like John moveindriver Jeep? Is there some way the game can detect the player's mission editor name and add that in instead of John? Thanks.

How about
Code: [Select]
player moveInDriver jeep?
"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 Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: Any idea
« Reply #3 on: 18 Aug 2007, 00:24:07 »
Okay, before I commence my object, would this work for the .sqs?:
this setpos [(getpos this select 0),(getpos this select 1),1]

So basically when I get the .sqs executed, it'll make the player go about half a metre or so in the air.

If yes, I'll start on the project. Also, how would I make the action continuous? Very sorry for the questions - I'm not exactly the best at mapping for OFP.

Thanks very much guys. :D

* Edit:
Woot! It worked! Thanks guys!

Chris :)
« Last Edit: 18 Aug 2007, 00:31:45 by Chris »
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!