Home   Help Search Login Register  

Author Topic: A few Q's  (Read 1801 times)

0 Members and 1 Guest are viewing this topic.

GI-YO

  • Guest
A few Q's
« on: 06 Jul 2004, 16:05:47 »
Hello there, i'm here to ask a few questions o which I could find no answers on the ol' search bit so here they are :

1- can you get soldiers to charge into enemy fire without hitting the deck, I was thinking of them being in SAFE mode but with some command to have their guns out.

2- How do you put single weapons on the floor like in sui's mission Facile ground (in the village) so it looks like someone dropped their gun?

3- is it possible to have a trigger/switch that will let you set off satchel charges without you haveing put them out. e.g satchel charges linked to a bridge to explode and you need to press the big red button.

thanks in advance.

GI-YO

Dubieman

  • Guest
Re:A few Q's
« Reply #1 on: 06 Jul 2004, 16:13:13 »
I have a pretty solid answer for 1 but the others... :-\

1.) In the soldiers init fields who are charging enemy positions put
this setunitpos "UP"
And give the soldiers some solid waypoints and they should stand up and run to the wp without ducking or anything.


2.)No idea, probably came up some time before, search the forums?

3.)Maybe have some type of explosive object on the bridge named bomb1 and in the radio trig when alpha is called bomb1 setdammage 1  or something like that.

I know there is a better way to do it though... :P

Offline Blanco

  • Former Staff
  • ****
Re:A few Q's
« Reply #2 on: 06 Jul 2004, 16:22:31 »
2 - You need a weaponholder. Do a search for that word and I'm sure you will find something usefull.
A weaponholder is nothing more than an invisible weaponcrate, but you can't find & place him in the editor, you have to create him.
Why don't you unpack that mission, so you can see how Sui did it. It's the best way to learn things, believe me. :)

 
« Last Edit: 06 Jul 2004, 16:25:10 by Blanco »
Search or search or search before you ask.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:A few Q's
« Reply #3 on: 06 Jul 2004, 16:51:03 »
3)   Tell us more about what you are trying to do.    Does it have to be satchels?    Have they been placed there earlier in the mission?   Or do you just need a big bang?

I wrote about weaponholders the other day somewhere.   Search the forum.
Plenty of reviewed ArmA missions for you to play

GI-YO

  • Guest
Re:A few Q's
« Reply #4 on: 06 Jul 2004, 20:05:48 »
A big bang would be just as good. I shall have a look for weaponsholders. thanks again for all the help.

GI-YO

'edit' I've found this info about weaponsholders "add a weapon holder at the civvy cutscene
weaponH1 = "weaponholder" createVehicle getMarkerPos "WH"
weaponH1 addMagazineCargo ["kozliceball", 4]
weaponH1 addMagazineCargo ["kozliceshell", 4]
weaponH1 addWeaponCargo ["kozlice", 1]
weaponH1 setPos getMarkerPos "WH"
weaponH1 setDir 70
Use createVehicle to create an object of following type:

"SecondaryWeaponHolder" to hold secondary weapon (LAW...)
"WeaponHolder" to hold primary weapon, handgun or magazine

This holder is empty by default and it acts like an ammo crate - you can use addMagazineCargo and addWeaponCargo functions to add weapon or magazine to it.

Magazines turn it into a satchel-like item (same as in game when dropping magazines), and weapons turn into the appropriate model." but being dim I dont understand any of what it says. But i do understand about the primary and secondary weapons but that realy doesn't help  ;D
« Last Edit: 06 Jul 2004, 20:20:40 by GI-YO »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:A few Q's
« Reply #5 on: 06 Jul 2004, 23:11:48 »
OK well lets break it down.

A weaponholder is an invisible ammo crate.    It cannot be created in the mission editor:  usually they are created in init.sqs but you could do it in a script, trigger or waypoint if you really need to.    Lets say that you wanted to create a weaponholder with a fully loaded kozlice, at the position of a marker called "WH" and with the weapon pointing in a particular direction:  you would write this code in your init.sqs

weaponH1 = "weaponholder" createVehicle getMarkerPos "WH"
weaponH1 addMagazineCargo ["kozliceball", 4]
weaponH1 addMagazineCargo ["kozliceshell", 4]
weaponH1 addWeaponCargo ["kozlice", 1]
weaponH1 setPos getMarkerPos "WH"
weaponH1 setDir 70

In this case it's named weaponH1 but you can call it anything you like.    If you put in one weapon then the thing you will see in the mission is that weapon:   if you put only magazines in it (no weapon) then you will see a satchel-like object on the ground, the same as the object you see if you drop a magazine while playing a mission.   (I'm not sure what happens if you put more than one weapon in, I think you see the first weapon added.)

Does that help?   Just try it and see.

Another example:

weaponHolder2 = "weaponholder" createVehicle getMarkerPos "base"
weaponH1 addMagazineCargo ["M16", 4]
weaponH1 addWeaponCargo ["M16", 1]
Plenty of reviewed ArmA missions for you to play

GI-YO

  • Guest
Re:A few Q's
« Reply #6 on: 07 Jul 2004, 14:30:28 »
when I put this
weaponH1 = "weaponholder" createVehicle getMarkerPos "WH"
weaponH1 addMagazineCargo ["kozliceball", 4]
weaponH1 addMagazineCargo ["kozliceshell", 4]
weaponH1 addWeaponCargo ["kozlice", 1]
weaponH1 setPos getMarkerPos "WH"
weaponH1 setDir 70
 
into the init field (of my player) it comes up with the error "weapon H1 not found". Is this because i'm using the wrong init feild or putting it in the wrong place?

GI-YO


Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:A few Q's
« Reply #7 on: 07 Jul 2004, 15:10:54 »
It doesn't relate specifically to the player so don't put it in his init field:  put it in you init.sqs file.      It's very hard to spot mistakes in an init line (or in a trigger or waypoint) if you have more than acouple of lines of code, so it's good practice to put the code where you can actually see it, like a script file.  Also, in an init field, the lines of code must be separated by a semicolon ; whereas in a script file this is not necessary.   Read Johan Gustafsson's Scripting Guide and snYpir's Friendly Intro to Code Snippets before going any further.

Do you have a marker called "WH" on the map?    weapon H1 and weaponH1 are not the same, and from the error message it looks like there might be a typo somewhere.



Plenty of reviewed ArmA missions for you to play

GI-YO

  • Guest
Re:A few Q's
« Reply #8 on: 08 Jul 2004, 13:28:51 »
I've got this little script

weaponHolder2 = "weaponholder" createVehicle getMarkerPos "GUN"
weaponH1 addMagazineCargo ["M16", 4]
weaponH1 addWeaponCargo ["M16", 1]

which I have saved as "m16floor.sqs" in Chris OFP script editor and have a marker called "GUN" on the map and it still won't work. I have put this script file into my user\missions\missionname folder and have tryed putting m16floor.sqs into the script line in the waypoint box and still nothing. This has realy got me stumped!

GI-YO

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:A few Q's
« Reply #9 on: 08 Jul 2004, 15:11:21 »
Stop and think about what you are doing for a minute.  

Read through your script again.   Can you spot the mistake?   It's really, really obvious ... you'll kick yourself.   ;D (Don't worry, we've all done it.)

First you create a weaponholder called weaponHolder2, right?    A weaponholder is just an invisible ammo crate, right?   So it doesn't have anything in it.   If you want to add something you have to, well add it.    Giving commands to an uncreated weaponholder called weaponH1 isn't going to get you anywhere:    you must add things to the weaponholder you have actually created, in this case weaponHolder2.

weaponHolder2 = "weaponholder" createVehicle getMarkerPos "GUN"
weaponHolder2 addMagazineCargo ["M16", 4]
weaponHolder2 addWeaponCargo ["M16", 1]
Plenty of reviewed ArmA missions for you to play

PsyWarrior

  • Guest
Re:A few Q's
« Reply #10 on: 08 Jul 2004, 16:04:16 »
Greets,

Also, try renaming the script "m16floor.sqs" to "init.sqs". In that way, it will automatically be executed (activated) as soon as the mission starts. You don't have to put it in the script box of a waypoint, or anywhere else.

Quote
Don't worry, we've all done it.)
Agreed. Possibly the most common error in sqs ever. I hate the hours of wondering why various scripts don't work that have turned out to be because of this... :P

-Supr. Cmdr. PsyWarrior
-Psychic Productions.

GI-YO

  • Guest
Re:A few Q's
« Reply #11 on: 08 Jul 2004, 17:57:54 »
Well thanks again macguba + co, I now see what I was doing wrong but at least i'm not the first  ;). Now my missions are going to be packed with discarded weapons to add some varity!!

GI-YO