Home   Help Search Login Register  

Author Topic: Some (Hopefully) not so simple questions  (Read 1316 times)

0 Members and 1 Guest are viewing this topic.

Offline Roni

  • Members
  • *
  • Play the Game !
Some (Hopefully) not so simple questions
« on: 06 Oct 2003, 12:46:49 »
Okay, I've read the Command Refs, run through the tutorials and FAQ's and ploughed through the forums - there are a still a lot of seemingly simple things I still don't know the answer to.  So here is a selection of things that I am seeking answers to from the group.

And if I DID just overlook the answers in the references somehow please forgive me !


First - what is the correct syntax for multiple parameters for an "if . . . then" statement ?  Is it - "? a: x, y, z", "? a: {x; y; z}",  "? a: [x; y; z]" or something else ?  I thought that the last answer was the "correct" way then I went through a bunch of posted scripts and it looks like the first way is the standard.  Help !

Second - Is there any way of knowing which commands work in which version of the game ?  For instance - I asked for help on a script and was told to use the setVelocity command, which after some effort I discovered does NOT work in version 1.46 (my version).  >:(    I was thinking about making a "While . . . Do" loop but am not sure if it will work.  Help !

Third - Is there any way of finding out the identity of the nearest player character ?  Sort of a nearestObject for players ?  I want to make a script that links an object to the nearest player and need some way of finding out who that is.  Help !

Fourth - When an action is run who is it that actually runs the action ?  In other words - if I make an object and addaction to it, then a player walks up to it and runs the action to whom would "this" refer ?  I want to write a script ("Pitch Tent") that creates a "Tent" object and removes the "Pitch Tent" action from the player.  The Tent will have its own associated action - "Pack up Tent" which removes the Tent and adds the "Pitch Tent" action back to the packing player.  Help !

Fifth - Is there any way of finding out which commands are related to each other ?  For example  - skipTime and accTime.  It would be really helpful if there was some way of knowing all the ways that you can make a loop, modify a characters behaviour or whatever.  Help !

Sixth - Is there anywhere that I can find a tree diagram of every class in the game ?  For example - a Vulcan is of Class M113, which is of Class APC (?), which is of Class Vehicle etc.  What are the classes ?  Is a buidling a vehicle or vice versa ?  Some of the commands noted in the Command Ref say that they only work on vehicles (eg setVelocity) - so what's a vehicle ?  Some only work on flammable objects (eg inFlame) - so what is a flammable object ?  Help !


That's about it for now.  I LOVE scripting and the resources are fantastically helpful, but because they weren't written from the ground up some fundamentals are missing (eg - syntax for compound "if . . . then" statements) and there is no summary of many of the "things" in the game (eg Classes).

Note though that the above is definitely not a criticism (I can tell how much of this was built on the love of a few selfless individuals and I thank you all profusely !!) - just a call from the wild by a perplexed and anxious scripter.



Roni

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Some (Hopefully) not so simple questions
« Reply #1 on: 06 Oct 2003, 13:50:16 »
We always forgive people who search for answers and fail to to find them ... it's happened to us all.  ;)    We also forguve noobs who don't know where or how to look.   What we don't like is people either don't read sticky topics at the top of the board or ask questions without doing their homework.    


2)  The short answer is no, although we do have old versions of the command ref in the Ed Depot.    You would still have to check each one in turn though, to find out when the command you're interested in was added.    BIS upgrade readmes can help here too.   However, the plain fact is that backwards compatability is good - higher versions of the game can usually cope with missions/addons created in lower versions.     But the easy answer is get Resistance if you possibly can - it was worth it even at the new release price.   Once you've got it upgrade to the lastest version 1.92.

5)  If you look at the online command ref which has helpful comments.  It's under References in the left hand menu bar in the Ed Depot.    Sometimes people have cross-referenced related commands.     I also strongly recommend that you read through the command reference as if it were a book.    I don't mean learning the details of every command, but just to discover what commands are there, what can be done.   Don't forget the special sections like Scripting topics.

6)  I have a feeling I have seen something like this, though suspect its old and not sure where.   Unofficial command ref?     This is one of the cases where, if you find out the answer, please write it up and post it as a tutorial.
Plenty of reviewed ArmA missions for you to play

deaddog

  • Guest
Re:Some (Hopefully) not so simple questions
« Reply #2 on: 06 Oct 2003, 15:18:00 »
I think you will find OFP to be an interesting programming experience :)  You should probably keep in mind that BIS designed scripting originally for themselves, not really the general public.  They know the game inside out and didn't make it as user friendly as possible.  :(

The only real way to learn is my making missions and trial and error.  Most everything has been figured out and is somewhere in these forums.  Read all the tutes in the ed depot and you will be well on your way  ;D

To answer your question about addaction, use a variable to store the action id:

actionid1=player addaction ["Pitch tent","pitchtent.sqs"]

and later

player removeaction actionid1

I'm not sure if there is a way of knowing exactly who initiated the action.  If you are writing this for multiplayer, the easiest way is to have a different script for each player:

pitchtent1.sqs
pitchtent2.sqs
etc

That way, the tent can be created near that particular player.  Or just have an action for the group leader only:  makecamp.sqs , and the camp magically appears  :)

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Some (Hopefully) not so simple questions
« Reply #3 on: 07 Oct 2003, 02:22:04 »
Thanks all - I knew that some of the questions were stupid - I just had to dump them all to get them out of my head ! :P

I am currently making up a 12 player multiplayer scenario about Iraqi Fedayeen (East) vs Iraqi Police (Resistance - Pro West) and US Regulars (West).  I'm chucking in heaps of scripts (probably too many - I'll see how it goes).  I'm using time dilation to make each day pass in around 20 minutes.

One set of scripts will allow a player to set create a tent object ("pitchcamp.sqs"), which once emplaced will allow the player to build a fire ("buildfire.sqs").  The player will then be able to light the fire and recover all of his lost health ("recover.sqs").  And at night, I am going to have a routine in the init.sqs that saps players healths unless they are in a vehicle or prone and in a building (hence the need for players to curl up in the tent).

What I am looking for is way to pack up the tent (I don't care bout the fire - leaving it behind will allow enemy to track you down !)(Idea ! - allow black ops characters to hide an old fire cf "Hide Body" ?).  I was going to remove the Pitch Tent action from the player once the tent was up, I just needed a way to add it back once the player removed the tent.

That's why I want to know a way to identify the actioning player.  If it is MY character that is packing up the tent then I want the script to remove the tent, then add the action back to MY character.  AS you can see  this is only a prolem because I am trying to do it in multiplayer.

Any ideas or is this too weird ?



Roni
« Last Edit: 07 Oct 2003, 02:24:34 by Roni »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Some (Hopefully) not so simple questions
« Reply #4 on: 07 Oct 2003, 02:35:17 »
ill answer da Qs up dere :P ;D

1) u got it - da way is  

? a: x, y, z

2) if u get da official command referance - 1 part of it got history referance 4 commands (or somin like dat ::)) each ver nd wich commands interduced - while loops r only 4 resistance :P  :-X

3) use arrays 4 dat ;) nd loop

4) yes dere is - in action script

_this select 0 is da man who made da action
_this select 1 is da object dat da action is attached 2
_this select 2 is da actionID

(or mebe it was da oder way around ::) if it doesnt work den

_this select 0 is da object n _this select 1 is da actioneer ;D)

5) somin somin macca said somin somin ::)

6) somin somin macca said somin somin ::)

as 4 ur newest post

i think i gave u da command 4 dat ? ;D

WELLCOME 2 DA FORUMS M8

:cheers:

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Some (Hopefully) not so simple questions
« Reply #5 on: 07 Oct 2003, 06:28:02 »
Thanks LCD (and deaddog and mac . . . )

I'll put the finished works in the scripting forum when they're done.

GOD - I love this game !



Roni

"Still working on coding a civilian serving my character a cappuccino . . . "