Home   Help Search Login Register  

Author Topic: SetCaptive false does not work?  (Read 2219 times)

0 Members and 2 Guests are viewing this topic.

Lancer512

  • Guest
SetCaptive false does not work?
« on: 19 Oct 2002, 16:04:01 »
I am trying to resue hostages, which have been initialized with the "unit setCaptive true" command.
 
However, when the player now enters the room with the hostages, I want the hostages to be on the "West" side again, i.e. the enemy units should attack them. How do I do that? A player-only trigger with "unit setCaptive false" does not seem to work...

« Last Edit: 19 Oct 2002, 16:09:13 by Lancer512 »

Wolf

  • Guest
Re:SetCaptive false does not work?
« Reply #1 on: 19 Oct 2002, 17:11:18 »
I have never had a problem with the unitname Setcaptive true\false command, all I can suggest is, have the join a leader who is not setcaptive true, other wise, I have no idea.
« Last Edit: 19 Oct 2002, 17:15:08 by Wolf »

Lancer512

  • Guest
Re:SetCaptive false does not work?
« Reply #2 on: 19 Oct 2002, 22:10:18 »
I tried that. The trigger lets them join the player, who is not captive. Not even a single east soldier fires on the hostages, just on me...

I then tried to get them "uncaptive" with a radio command, the command is issued correctly, but again, nothing happens.

Could it be that my mission is too large (mission.sqm is 81kb and 8 kb worth of scripts)?

seanver

  • Guest
Re:SetCaptive false does not work?
« Reply #3 on: 19 Oct 2002, 22:20:19 »
Are the hostages civilians?

Lancer512

  • Guest
Re:SetCaptive false does not work?
« Reply #4 on: 19 Oct 2002, 23:47:42 »
No. I used the default west soldiers (pilot, medic, officer,soldier) and removed their ammo and weapons.
 

Lancer512

  • Guest
Re:SetCaptive false does not work?
« Reply #5 on: 20 Oct 2002, 12:18:14 »
OK. I figured it out... I just got stupid when I coded that trigger...

Once the player enters the trigger, all hostages join one hostage leader (if I assign them to the hostage leader from the beginning, they will start to walk around).
Then, in turn, I wanted to use "_x setCaptive HLdr false" foreach (units group HLdr); to get them all at once back to be a threat to the enemy.

Instead, I used the local variable name _y, which does nothing... I changed that to _x and all works fine now...
 ;D

Is there a reference to look up all the pre-set variables, like aP, _x and whatever else is there?

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:SetCaptive false does not work?
« Reply #6 on: 20 Oct 2002, 13:19:10 »
dunno about that - but aP isnt a precoded variable as far as i know... i use it as the name for the player at all times tho - dunno why, but it stops me becoming confused with too many names.
Proud Member of the Volunteer Commando Battalion

Moulder

  • Guest
Re:SetCaptive false does not work?
« Reply #7 on: 03 Nov 2002, 02:19:56 »
im doing a similar mission to rescue hostages, im not famaliar with the things you are talkin about. Is there any way someone can like make a notepad of what to do then maybe attach it. Please that would help great, just want it to where we go in and go up to them, then rescue them and they follow us.
thanx.

Lancer512

  • Guest
Re:SetCaptive false does not work?
« Reply #8 on: 03 Nov 2002, 10:59:50 »
Actually, it is really simple... But it's always easier afterwards.

- Put your hostages into a building or whatever you want them to be hidden in. Do not assign it to any other unit (make sure there are no grouping-lines onhe hostages). Otherwise they will fall back into formation and eventually walk out of the building.

- Set each of the hostages to captive with unit setCaptive true. This makes the bad guys treat them like bad guys, but the hostages shoot back. (This is good when you want to test a mission. nobody will shoot you, but you can trigger everything).

- Put a trigger where you want them to be rescued and have the trigger set off only by your human player. with the F2 key, draw a line fom the trigger to your player, and select group leader or whatever you think is practical in the "activated by" field of the trigger.

- In the trigger "activation" field, either let each hostage join you by it self, or first let the hostages join a "hostage leader", and let the whole group join you. Then make them uncaptive again. You can also make them uncaptive first, and then join you. That depends on you...

each hostage by itself
unit1 join Player; unit2 join player, etc...
unit1 setcaptive false; unit2 setcaptive false, etc...

for the hostages to be a group (good for many hostages)
unit1 join HostLdr; unit2 join HostLdr; etc...
i]"_x setcaptive false" foreach (units group HostLdr)[/i]
HostLdr join Player


I hope this works fo you. I just wrote this up from my mind. If you do have any questions.. Well, this is what this forum is for...
 

Moulder

  • Guest
Re:SetCaptive false does not work?
« Reply #9 on: 03 Nov 2002, 11:25:16 »
thanx man, i have something set already, i just kinda messed around with it. i still have to test it, but the enemies are too hard cant get past them. lol
If that dosent work what i tried, i will try what you put.
thanx lancer

Moulder

  • Guest
Re:SetCaptive false does not work?
« Reply #10 on: 03 Nov 2002, 20:57:32 »
ok, i added in what you put with the captives. and this is the code i used int he trigger activation field, tell me what i did wrong, cause i got an error when i tried to preview it

unit1 join HostLdr1; unit2 join HostLdr1; unit3 join HostLdr2; unit4 join HostLdr2; HostLdr1; HostLdr2 join Player
i have 6 captives, 2 are hostage leaders. i know i did something wrong, but cant figure out what. well get back to me when you get a chance
thanx

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:SetCaptive false does not work?
« Reply #11 on: 03 Nov 2002, 22:45:12 »
*cough*

 shouldn't that of been [Unit1] join HostLdr1  :o :)








Moulder

  • Guest
Re:SetCaptive false does not work?
« Reply #12 on: 03 Nov 2002, 22:48:46 »
thanx ill try it

Moulder

  • Guest
Re:SetCaptive false does not work?
« Reply #13 on: 03 Nov 2002, 22:56:45 »
nope didtn work try again

Lancer512

  • Guest
Re:SetCaptive false does not work?
« Reply #14 on: 03 Nov 2002, 23:24:17 »
I guess you'll only need the square parenthesis (sp?) when you are using a script or in this case where I am using the command with more than one unit at the same time.

This is how my trigger looks like:
Activation: Any group member,Once, Present, Countdown "0"
Type: none
Condition: this
On Activation: [W5_1,W5_2] join W5; "_x setcaptive false" foreach (units group W5); "[_x] join W1" foreach (units group W5);


W5 is the hostage leader, and W5_1 and W5_2 the other hostages. The player is W1. However, I just found out today, that when you send W5 somewhere, the other two units will still follow him, unless you order them one by one to do something, too.

You could also add some sound to the trigger to see if it actually is triggered. I thought I had some problems with the units on some occasions, but the trigger was never really activated.

« Last Edit: 03 Nov 2002, 23:27:10 by Lancer512 »