OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: oWn on 04 Feb 2004, 09:09:51

Title: Civil soldiers?
Post by: oWn on 04 Feb 2004, 09:09:51
How to make civilians to enemies? so the AIs shoot them? :-\
Title: Re:Civil soldiers?
Post by: macguba on 04 Feb 2004, 11:06:42
Create a civvy.   Create for example an East soldier, make him higher rank than the civvy.   Group the civvy to him, so that East is the group leader.    In the init field of the eastloon write this

deleteVehicle this

When the mission starts the eastloon will be deleted leaving the civvy as an "east" soldier.   West will shoot at him.
Title: Re:Civil soldiers?
Post by: oWn on 04 Feb 2004, 12:29:06
I will try that! thanks!
but will the civilian shoot back on the west guys?
Title: Re:Civil soldiers?
Post by: Kaptain_Karl on 04 Feb 2004, 13:06:34
I think they will only shoot back if you give them a weapon with the addWeapon and addMagazine commands.  :-\
Title: Re:Civil soldiers?
Post by: Pathy on 04 Feb 2004, 13:43:56
If you know the model paths for the civilians you could make a "new" addon, basically just a config file in a pbo. It'd select the model and config an alternative version as a west soldier, that way you wouldnt have to go thru all the crap of scripting them.
Title: Re:Civil soldiers?
Post by: oWn on 05 Feb 2004, 08:43:56
well they are not shooting back when they have a weapon... I don't think they know how  :P
Title: Re:Civil soldiers?
Post by: Artak on 05 Feb 2004, 10:40:41
The civilians will shoot back if you did it like macguba said. There's no need to make yet another useless addon when you can have the same effect with scripting. Here's a run through of the method again.

Create a civilian with a private's rank. Put in his init field: this addmagazine "ak47"; this addweapon "ak47"

Create a east officer with a captain's rank. Put in his init field: deletevehicle this.

Group the above units together.

Create a west soldier nearby the civillian.

Watch them shoot their brains out.  ;D
Title: Re:Civil soldiers?
Post by: oWn on 05 Feb 2004, 12:26:23
Nope the civilian dosen't blow anyting out.. he youst lying there as a fool..
When I shoot the civilian the weapon not even reloaded...
Title: Re:Civil soldiers?
Post by: macguba on 05 Feb 2004, 13:22:56
You must add a magazine before the weapon.   Write in the init line of the civvy:-

this addMagzine "m16";   this addWeapon "m16"

What happened when you changed the civvy to Player and Previewed the mission?
Title: Re:Civil soldiers?
Post by: oWn on 05 Feb 2004, 14:03:08
Please I'm not a noob! Ofcourse i added some ammo! But the civvy dosent do anything! When I test the civilian i can shoot and all.. but the weapon has no ammo in it from the begining, as usual... :-\
Title: Re:Civil soldiers?
Post by: PsyWarrior on 05 Feb 2004, 14:49:09
Greetings oWn,

Could you post the exact code that you put in the INIT line?

Make sure it matches this format:

Code: [Select]
this addMagazine "AK74"; this addMagazine "AK74"; this addWeapon "AK74"
the "AK74" can be "M16" or any other type of weapon. Be careful, though as some weapons like the G36a have different names for magazines (for example "G36a" is the name of the weapon, G36amag" is the ammo).

This is not a problem with the M16 or the AK74 though - they have the same name for ammo and weapon.

Of course, It could be some other problem. By default, I don't think civies have any proper combat AI (don't respond to doTarget commands, etc.), but this problem should be solved once you put them on the East side. Do the West guys see them as enemies - do they attack them?

It could also be that the west soldiers kill the civilians before they have time to reload. Make sure that you put the ammo in before you give them the weapon. This is the Golden Rule of adding weapons.

Hope that was, in some way, helpful...

Good luck, :thumbsup:

-Supreme Commander PsyWarrior
-Psychic Productions
Title: Re:Civil soldiers?
Post by: macguba on 05 Feb 2004, 14:51:18
I just tested it and it worked fine for me.     Civvy had ammo and weapon and shot the west loon straight away.

Are you sure you added the ammo before the weapon like I said?


Edit:  just seen PsyWarrior's post
Title: Re:Civil soldiers?
Post by: dmakatra on 05 Feb 2004, 20:39:27
Which version do you use oWn?

:beat: *Gets Shot* :beat:
Title: Re:Civil soldiers?
Post by: oWn on 06 Feb 2004, 08:35:30
version hrm... Iam not at home but i think it is 1.175 (the one you get after installing resistance).

Now when I read that you shood put the ammo Before the weapon I haven't try that...  But when I put out like 12 civil guys with guns and all
[This addweapon "ak47"; this addmagazine "ak47";] and shoot down like 11 off them the one left shot back!  :D
Title: Re:Civil soldiers?
Post by: Artak on 06 Feb 2004, 08:39:34
Maybe he's had enough time to reload  ::)

If you add the magazines before the weapon, the weapon is loaded and the moron is ready to shoot, otherwise they'll have to reload.
Title: Re:Civil soldiers?
Post by: oWn on 06 Feb 2004, 08:44:43
it dosen't matter how long you wait the civvys refuse to shoot.. west guys shoot at them so its not that they not are enemies...
Title: Re:Civil soldiers?
Post by: Artak on 06 Feb 2004, 10:20:11
Hmm.. we are having no progress.

If the attachments work, can you please attach your mission.sqs here and I'll have a look at it. (no addons please)

Or e-mail it to me at arto.soininen@phnet.fi
Title: Re:Civil soldiers?
Post by: oWn on 06 Feb 2004, 10:31:18
maybe later.. when i come home I'll try to set the addmagazine first in line.. if thats not working I'll mail you.   ::)
Title: Re:Civil soldiers?
Post by: Planck on 06 Feb 2004, 20:39:34
You mean you didn't try yet to add a magazine first, after everyone has been telling you this is the way to do it.

I don't understand that.


Planck
Title: Re:Civil soldiers?
Post by: PsyWarrior on 07 Feb 2004, 18:09:38
Greetings,

@Planck - Comments like this are not helpful to the current situstion. I understand exactly what you are saying, but it helps to bear in mind that not everyone's English comprehension is so good. oWn is clearly from Sweden, so it takes effort to try and decypher what everyone is writing. The OFPEC is founded on patience and co-operation, it's what makes this site so great  ;)

@oWn - So how long does it take you to get home  ::). Did putting addMagazine first help, or are the civilians still getting shot up? :gunman:

-Supr. Cmdr. PsyWarrior
-Psychic Productions
Title: Re:Civil soldiers?
Post by: Planck on 07 Feb 2004, 19:34:34
Point taken PsyWarrior, however, he was told more than once.

Would be nice to know if he got it working yet or not though.



Planck
Title: Re:Civil soldiers?
Post by: oWn on 09 Feb 2004, 08:47:00
every thing is working now the civilian is shooting back  :D
It wasent the addmagazine... But it working now..
Title: Re:Civil soldiers?
Post by: PsyWarrior on 09 Feb 2004, 12:46:12
Great!

What was the problem in the end, then?

-Supr. Cmdr. PsyWarrior
-Psychic Productions
Title: Re:Civil soldiers?
Post by: Tillverkad on 16 Feb 2004, 08:13:32
I noticed a stupid bug in OFP when playing as a civilian. When you take a satchel charge (you can take it) and you already have a weapon (AK47), you can't put Satchel charge anywhere.  But if I don't have any weapons I can take and put satchel charges.  :-\

Would it be possible with a script? :P

I'm using OFP version 1.46
Title: Re:Civil soldiers?
Post by: TonyRanger on 15 Mar 2004, 13:57:05
xxx="soldierGfakeC"createvehicle pos
xxx="soldierGfakeC2"createvehicle pos