Home   Help Search Login Register  

Author Topic: Joining Civilian Side  (Read 3245 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Joining Civilian Side
« on: 19 Oct 2010, 01:20:48 »
If you make a(non-civilian) unit join a Civilian group, its side is still displayed as its original side. Any idea why?

Not only that but if you are on the same original side(but in a different group), the unit becomes hostile to you. It is bizarre.
« Last Edit: 20 Oct 2010, 15:35:10 by Mr.Peanut »
urp!

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Joining Civilian Side
« Reply #1 on: 19 Oct 2010, 02:30:07 »
1. The red name, green name thing? That's because every unit has its side set in the config (e.g. side=1;). Every time the engine displays a name it takes this value to decide which color to use. As you might have already guessed by now this can't be changed via scripts [1].

2. Check the "Independents are friendly to:" settings in the editor. Every side not on the list becomes an enemy of side civilian and side resistance (you can verify this with getFriend). But in case of side civilian the opposite is not true! East and west are always friendly to side civilian (except when explicitly changed via script).

The sole reason civilians do not kill the "unfriendly" side is because they lack the means to do so. But if you add an armed guy to side civilian he knows what to do.


[1] That's not quite true. With the mergeConfigFile command which was added in one of the betas you can modify the config on the fly. But you have to create a custom config first.
« Last Edit: 19 Oct 2010, 02:35:15 by Worldeater »
try { return true; } finally { return false; }

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Joining Civilian Side
« Reply #2 on: 19 Oct 2010, 14:04:06 »
This was the situation. A friend had a mission that ended with an East Not Present Trigger, but he wanted East units that were fleeing to be removed so that the last few fleeing East stragglers would not have to be hunted down.

My thought was that I could add the fleeing units to the civilian side. I made a quick test with a group of enemy east riflemen, and myself and a friendly couple of Abrams. With allowFleeing=1 the East units automatically start fleeing, and I joined them to a high ranking Civilian. However, after being joined some of the units would remain side East and others would display as side Civ, and they started killing each other.
urp!

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Joining Civilian Side
« Reply #3 on: 19 Oct 2010, 14:55:43 »
I believe setting a unit to setcaptive true will automatically turn them into civilians, thus bypassing the "east not present" trigger. You could simply make it so a fleeing unit drops their weapon upon starting to flee (e.g. fleeingunit action ["dropWeapon", fleeingUnit, primaryweapon fleeingunit]) which would stop them from shooting anyone up :)

Alternatively, why not factor in the fleeing units into the east not present trigger? Change it to an East Present one,and make the condition something like:
Code: [Select]
(({alive _x} count thisList) - ({fleeing _x} count thisList)) < 5
Just change it to "less than 1" and it should trigger the moment there are no living, not-fleeing people left in the area :) Might have to fiddle with the counts,but you get the idea.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Joining Civilian Side
« Reply #4 on: 19 Oct 2010, 15:39:40 »
Thanks wolf. Of course I was trying to make a complicated solution instead of a simple one... :blink:
urp!

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Joining Civilian Side - SOLVED
« Reply #5 on: 20 Oct 2010, 14:13:00 »
I'm not sure I have the same problem, but maybe this is my problem place too...

Yesterday I created a mission where player (blue) is attacked by GUER (independent) units. I didn't want set the "independent is friendly" switch in the mission, because if I set Independent friendly to red, the civilians start affraid from blue. But in the mission player (blue) have to act with normal civilians... and I don't want laying and scareing civilians... So I spawn this GUER units by script and added them to an EAST group. Well: I create an empty EAST group first, and then I create the soldiers one by one into this group.

The result have two problems:

1., OPFOR detected by BLUE never activated (it seems, this new group is not on east side)

2., This new, spawned units is very friendly to the player... :) Never attack, just run for him.

Any advice?
Fix bayonet!

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Joining Civilian Side - SOLVED
« Reply #6 on: 20 Oct 2010, 14:32:19 »
@bardosy

I suggest you do this the old fashioned way instead ;) It's all very well to spawn things and create groups out of nothing and stuff, but when push comes to shove, nothing can beat the old "group unit with leader from another side with probability of presence = 0%". At least we know that works, right?

Alternatively, can't you use setFriend? I mean - once there's shooting between you and the guerillas, won't the civilians get pretty scared (of you and of everyone) anyway? So I don't think it'd be too far fetched to wait until the moment when you want the shooting to start, and then just setfriend the resistance to dislike you.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Joining Civilian Side - SOLVED
« Reply #7 on: 20 Oct 2010, 15:23:09 »
bardosy's problem is the same as mine. After joining East to a group of side Resistance, do they register as Resistance in a trigger? My experience with Civ suggests they will not.

I tried joining editor placed East units to a Civilian on the map. I also tried joining them to a createGroup. In both instances, my East Not Present trigger did not fire until they were all dead.
« Last Edit: 20 Oct 2010, 15:27:34 by Mr.Peanut »
urp!

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Joining Civilian Side
« Reply #8 on: 20 Oct 2010, 18:49:52 »
Thanks wolfrug! When I read your post I got an idea: I forgot to insert a single OPFOR guy somewhere on the map. I experienced it earlier, if there is no EAST guy on the map, it's impossible to create an EAST group on the fly. So first, I insert this guy to represent the east side.

It was funny, because then, the spawned (east sided) GUER units start to kill each other... They were in same group but hate each other.

So finally I use setFriend as you advised and it works!!! But I have to use it both east and west:

west setFriend [resistance, 0]
east setFriend [resistance, 1]

And now they come and attack me.

But OPFOR detect by BLUE still not working, because they are Independent... so I change the trigger to Independent detected by blue and it's OK.
I don't understand why are not opfor.

Thank you for your help!!!
Fix bayonet!

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Joining Civilian Side
« Reply #9 on: 21 Oct 2010, 02:45:50 »
okay here is the strange part. player is west unit. one civ unit and one east unit on map. if you try to get the east unit to join you with the join command it does not work. however, if you first group the east unit with the civ in the editor, it does. and of course you can group the east unit with you in the editor.

why does the join command not work when grouping in the editor does?
urp!

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Joining Civilian Side
« Reply #10 on: 21 Oct 2010, 13:57:46 »
Peanut:

Um. I just tested this in the editor (one west, one east named dude, one civ named dude2) with a trigger, activated by radio alpha: [dude] join player. Worked perfectly fine. Also tried it with a trigger activated immediately (condition: true), and that also worked no problem. I even tried it with a Join waypoint, which ALSO worked no problem.

Are you sure you're not using some addon that messes things up, or playing a test mission which featured a messed-up addon at some point (I once got very weird effects on triggers and various commands after I had removed a grasscutter addon: it just completely messed up the whole engine for some reason)?

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Joining Civilian Side
« Reply #11 on: 21 Oct 2010, 20:30:07 »
In the player init field, I had "grpW = group this". In the East init field I had [this] join grpW. I guess the group was not getting defined? I'll try from a radio trigger instead.

Can you successfully get the East unit to join a Civ group created using the createGroup command? That is where my problems started. Can't remember if I used a radio trigger or not...

edit: Uploaded a demo to illustrate the problem. East unit changes to side civ, but East Not Present trigger does not fire until after you kill the unit. Now if you were instead to join the unit to an existing Civ, all is fine.

edit2: Only works when East unit is grouped with Civ unit in editor. You can join an East unit to a Civ via commands, but the East not present trigger will not fire.
« Last Edit: 25 Oct 2010, 01:28:39 by Mr.Peanut »
urp!