Home   Help Search Login Register  

Author Topic: Create Vehicle Init Field  (Read 1560 times)

0 Members and 1 Guest are viewing this topic.

illmatic

  • Guest
Create Vehicle Init Field
« on: 02 Feb 2004, 18:28:24 »
I made a create vehicle script, want to know what i put to make the vehicle have something in the init field... thx  ;D

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Create Vehicle Init Field
« Reply #1 on: 02 Feb 2004, 19:24:03 »
Post the relevant parts of the script.    It helps if we know what you've done.
Plenty of reviewed ArmA missions for you to play

illmatic

  • Guest
Re:Create Vehicle Init Field
« Reply #2 on: 02 Feb 2004, 20:02:30 »

[["Buggy3", 1, "vcl"]], getpos NosCar, groupBravo, groupAlpha, "empty", 1, "CORPORAL"] exec "createsquad.sqs"
CreateSquadRunning = true
MyVcl = NewVcl
@!CreateSquadRunning
_leader = NewVcl select 0
[_leader] exec "lock.sqs"
_leader addaction ["Emergency Eject","carej.sqs"]
_leader setPos [getPos _leader select 0, getPos _leader select 1, (getPos _leader select 2) + 2]
_leader setDir 270
[_leader] exec "Recycler.sqs"




Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Create Vehicle Init Field
« Reply #3 on: 02 Feb 2004, 20:43:39 »
Is that the "relevant" part of the script? I don't even see the createvehicle command there.
Anyhow, I don't think you can even use the init field of createvehicled objects. However the init field does include in the createunit command syntax.

["Buggy3", 1, "vcl"], getpos NosCar, groupBravo, groupAlpha, "empty", 1, "CORPORAL"] exec "createsquad.sqs"

In the above the spot where it says "empty" reminds most the spot where the created unit's init field goes to.
The rest of that line is pretty much a mystery because that's not the syntax for createunit nor is it the syntax for createvehicle.. seems you're executing a file with it..

and btw you're missng a [ (among other things pharhaps)
« Last Edit: 02 Feb 2004, 20:44:20 by Artak »
Not all is lost.

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Create Vehicle Init Field
« Reply #4 on: 02 Feb 2004, 23:29:57 »
lol, wtf did YOU have for breakfast, arty  ??? ::) ;D dang pee-eye-es-tee-off person!


 :D illmatic baby! when ya create an object/vehicle/unit,
it usually happens via a trigger or a scroll, right?! And so
the moron can be told/given whatever - in the script lines
that comes right after his creation! :thumbsup:


no need for an INIT field, as he is NOT present when the mission INIT's  :P ;D

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Create Vehicle Init Field
« Reply #5 on: 03 Feb 2004, 10:50:39 »
omg lol plz wtf  ;D ::)

What are you saying? That there's some special incridient in these chocolade brownies that I'm unaware of?  ;D :-X

[size=0.1]I've been having A LOT of stress lately.[/size]

nah but really, there IS actually a init field in the createunit command.

"OfficerE" createunit [GetMarkerPos _pos, _group, "", 0.8, "LIEUTENANT"]
It's those quotations there. If you put    this setbehaviour {safe}   in there you'll have an officer who is spawned in safe rather than aware.

I think the reason the createvehicle has no 'init field' is because you can't do any commands for a vehicle that would have an effect before the vehicle is created.
« Last Edit: 03 Feb 2004, 10:50:54 by Artak »
Not all is lost.

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Create Vehicle Init Field
« Reply #6 on: 03 Feb 2004, 12:31:36 »
You cant have a command in the "init" of a created vehicle.  Simply because the init is ran at the start of a mission, not at the creation of the unit.  A created unit has no "init".

If you need to give the vehicle commands, you'll have to give it a name when you create it and use the name, instead of this.

illmatic

  • Guest
Re:Create Vehicle Init Field
« Reply #7 on: 03 Feb 2004, 17:49:27 »
managed to get this sorted, i couldnt define the vehicles name because of how the rest of the maps scripted, i just did exec "blalalalala.sqs" and

_vcl=_this Select 0

_vcl setObjectTexture [0, "\Buggy3\Tex\BudBug.pac"];

ty anyway guys!! 8)

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Create Vehicle Init Field
« Reply #8 on: 03 Feb 2004, 18:53:07 »

...there IS actually a init field in the createunit command.

"OfficerE" createunit [GetMarkerPos _pos, _group, "", 0.8, "LIEUTENANT"]

It's those quotations there...



 :o ...and all these years I took his so called "INIT" field for a NAME field  ::)

as in :    "SoldierWB" CreateUnit [getPos "TeamLeader",groupalpha,"unitname=this",0.7,"Seargeant"]

thus: [spot, group, name, skill, rank]  :)

(not that I dont believe ya, arty m8, I just havent tried that yet - will do & see if it sticks!)
it could be sufficient enough with a so called "init" adding custom weapons etc.  :)
I must check this out (and I still doubt that this is a >>real<< INIT field with all the INIT possibilities).
cant see why a created unit shud need an INIT; I mean, you can just add whatever suff to him once you have his UNITNAME (which is why I take that field up there for a NAME field and certainly not an INIT field)


lets bet a sixpack on this one man! :cheers:





Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Create Vehicle Init Field
« Reply #9 on: 03 Feb 2004, 19:00:13 »
In the "init" field in a createUnit command you can certainly add weapons as well as name the unit.   I've always assumed you can put any code you like there, though I've never tested it thoroughly.      
Plenty of reviewed ArmA missions for you to play

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Create Vehicle Init Field
« Reply #10 on: 03 Feb 2004, 19:02:51 »
so be it, maccy  :) I must try this, I always add whatever stuff to my named created units,
but if I can put it in the "init" then its ok (only, it doesn't really save me from all the typing)  :P ;D
« Last Edit: 03 Feb 2004, 19:03:29 by Tomb »

DBR_ONIX

  • Guest
Re:Create Vehicle Init Field
« Reply #11 on: 16 Mar 2004, 18:02:52 »
Code: [Select]
From ye old command reference :
[quote]
type createUnit unitInfo
Operand types:
    type: String
    unitInfo: Array
Compatibility:
    Version 1.34 required.
Type of returned value:
    Nothing
Description:
    Create unit of given type . Format of unitInfo is: [pos (Position),group (Group), init (String), skill (Number), rank (String)] Note: init, skill, and rank are optional, default values are "", 0.5, "PRIVATE".

Example:
    "SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha]

I guess that you can put whatever you want there.. Apart form anything with "quotes" :hmm:
Because "this setunitpos "down"" has 2 extra quotes, so it has :
"this setunitpos "

down"

and

""
All seperated..

Can you use ' in place of " ?

I know you can in web based lanuages like PHP (As in, echo("Look, you can put 's in this, and it works fine.."); And you can also use echo('Hi!! " can be used here!!');  :))

But I'm not sure about ofp

In the mission .sqm file
It keeps sub quotes as they are.. Like init="this setunitpos "down""

no idea :P
Just though I'd argue a bit... ;)
- Ben [/quote]

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Create Vehicle Init Field
« Reply #12 on: 16 Mar 2004, 18:22:36 »
you can use {} instead of (and with) ""

For example

"_x setbehaviour {safe}" foreach units mygroupofmorons
Not all is lost.