Home   Help Search Login Register  

Author Topic: Scripting Basics  (Read 1323 times)

0 Members and 1 Guest are viewing this topic.

Offline snafu

  • Members
  • *
Scripting Basics
« on: 30 Jan 2009, 20:02:14 »
Hey all,

I have hit a ceiling with my editing skills, being limited to what I want with the scripts available. I want to learn but not sure where to start. I am not a coder and it takes me a long time to learn stuff like this; I still have nightmares of Visual Basic when I had to use it in school. So I need some help from you stand-up blokes.

Should I learn sqs or just focus on sqf seeing that ArmA favours it?

The first script I want to make is that when an enemy group is spotted by a friendly group/unit/vehicle a smoke grenade spawn at their location allowing the player to CAS their ass. It sounds basic enough but it probably isn't. Would this be easy enough for a newbie to attempt?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Scripting Basics
« Reply #1 on: 30 Jan 2009, 20:58:02 »
SQF, definitively. While you might still use SQS for small and quite basic scripts.
Try to put here your advances with your spot script and we'll provide clues to complete it.
« Last Edit: 30 Jan 2009, 22:31:52 by Mandoble »

Offline Ext3rmin4tor

  • Members
  • *
Re: Scripting Basics
« Reply #2 on: 30 Jan 2009, 22:08:58 »
I think he meant you may use SQS for basic scripts (as I do) or cutscenes. But it is better to learn SQF since ArmA2 will be likely SQF only.
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re: Scripting Basics
« Reply #3 on: 30 Jan 2009, 23:27:27 »
Although I'm a beginner in scripting myself, what's SQF mean? I know sqs is for your scripting files.

SQF another form of scripting?
Who's hyped for Arma4, long live Arma!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Scripting Basics
« Reply #4 on: 30 Jan 2009, 23:36:57 »
Yes, it is a different scripting language. Basic differences are in control/condition blocks like while, for, if, swich. Usage of sleep instead of ~, every line ending with ; and no more gotos/exit. And finally, the existance of scope areas for local variables, so that local variables might be local just to a control block and no to the entire script.

Offline Rommel92

  • Members
  • *
Re: Scripting Basics
« Reply #5 on: 31 Jan 2009, 00:48:25 »
Incase you haven't even started to begin attempting your script, you would have three parts.

#Detection
Detect that the BLUFOR groups knows of the OPFOR group, perhaps via a trigger?

#Interpretation
Ensure that the data is all correct by some debugging, and make sure that the group is indeed friendly etc.

#Processing
Get the BLUFOR group to throw the smoke grenade, and re-route your CAS to that position.

Interesting/Relevant Commands:

Alive - http://www.ofpec.com/COMREF/index.php?action=details&id=16
Count - http://www.ofpec.com/COMREF/index.php?action=details&id=77
CommandMove - http://www.ofpec.com/COMREF/index.php?action=details&id=70
OR
DoMove - http://www.ofpec.com/COMREF/index.php?action=details&id=111
Leader - http://www.ofpec.com/COMREF/index.php?action=details&id=193
CreateVehicleLocal - http://www.ofpec.com/COMREF/index.php?action=details&id=456
Group - http://www.ofpec.com/COMREF/index.php?action=details&id=157
Position - http://www.ofpec.com/COMREF/index.php?action=details&id=250""

Hopefully this will get you started a bit quicker.

 regards, Romm