Home   Help Search Login Register  

Author Topic: Problem with changing sides  (Read 2813 times)

0 Members and 1 Guest are viewing this topic.

GavinP

  • Guest
Problem with changing sides
« on: 17 Aug 2006, 22:04:40 »
I'm making a mission (Aren't we all!) where a meeting between 2 generals (1 east, 1 west) is going to take place. Obviously, in order to not make them kill each other, I've removed their weapons, but I've also grouped the east general with a civilian who I'm going to work into the story.

Problem is, they drive up, get out of the car and walk into the house just peachy, but when i try run the following I get an error.
Code: [Select]
[gen2] join ge1;gen2 addMagazine "tokarevmag";gen2 addWeapon "tokarev";[civ2] join w1;Gen2 reveal civ2; gen2 dotarget civ2; gen2 dofire civ2
(You can see how I'm going to write the civilian into the story can't you? :laugh:)

The error I get is Error reveal: type group, expected object

I've tried just running

Code: [Select]
[gen2] join ge1;gen2 addMagazine "tokarevmag";gen2 addWeapon "tokarev";[civ2] join w1;gen2 dotarget civ2; gen2 dofire civ2
But I get error dotarger, type group, expected object.

What am I doing wrong? When I substituted Gen2 with ge1, I got error dotarget: type group expected array,object

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Problem with changing sides
« Reply #1 on: 17 Aug 2006, 22:41:16 »
OFP thinks civ2 is a group, not a unit . Check your code to make sure the variable civ2 has not been assigned to a group.
« Last Edit: 17 Aug 2006, 22:46:06 by Mr.Peanut »
urp!

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re: Problem with changing sides
« Reply #2 on: 17 Aug 2006, 22:46:30 »
Well, i'm not to sure, but have you considered using a few setcaptive true and false commands to get the right effect? It might be easier that way.

Something like;

Code: [Select]
gen2 setbehaviour "CARELESS"
ge1 setbehaviour "CARELESS"
civ2 setbehaviour "CARELESS"

gen2 setunitpos "UP"
ge1 setunitpos "UP"
civ2 setunitpos "UP"

gen2 addMagazine "tokarevmag"
gen2 addWeapon "tokarev"

gen2 setcaptive true
ge1 setcaptive true
; (civ2 is grouped east)
civ2 setcaptive true

;Then they meet

civ2 setcaptive false

gen2 setbehaviour "AWARE"

;Gen2 should shoot civ2  ;)


That might work. Although I find that mixing setunitpos "UP" and setbehaviour "SAFE" causes the unit to be in the alert position constantly, not sure if this is the same with careless.

Of course, if Mr.Peanut's solution works, that would be easier  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****

GavinP

  • Guest
Re: Problem with changing sides
« Reply #4 on: 17 Aug 2006, 23:15:00 »
Hi,

Thanks for the help. I've managed to remove the errors. I had indeed f'd up the naming of civ2. Instead of the loon, i'd called the group.  I don't really want to use setcaptive because basically the mission is going to be escorting the west general to meet east general (gen2) who will shoot civ2 infront of west general, and then because he's east again, shoot the west general. All his escort will of course turn east and open up merry hell.

However, the following still won't make gen2 shoot civ2.

Code: [Select]
[gen2] join ge1;gen2 addMagazine "tokarevmag";gen2 addWeapon "tokarev";[civ2] join w1;[civ2] join groupnull;[gen2] join groupnull;gen2 selectWeapon "tokarev";ge1 reveal civ2;gen2 doTarget civ2;gen2 dofire civ2

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re: Problem with changing sides
« Reply #5 on: 17 Aug 2006, 23:30:22 »
grpNull is what you wanted to use in there?

GavinP

  • Guest
Re: Problem with changing sides
« Reply #6 on: 17 Aug 2006, 23:35:37 »
Indeed it was, but i'm clutching at straws at that point anyway. Having made the change, Gen2 still just stands and looks at Civ2.

Why is Ofp so complicated? ??? :banghead:

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Problem with changing sides
« Reply #7 on: 18 Aug 2006, 17:15:13 »
Why is Ofp so complicated? ??? :banghead:

Because there is a total lack of coherent documentation that forces everyone to engage in trial and error testing.  When learning a new language it is always helpful to have both a language reference and a user's guide.  We only have the language reference i.e. the ComRef.

Not sure why you have the following:
Code: [Select]
;[civ2] join grpNull;[gen2] join grpNullsince you already have civ2 joining w1 and gen2 joining ge1.

Trying putting the join grpNulls before the other joins.
« Last Edit: 18 Aug 2006, 17:22:25 by Mr.Peanut »
urp!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: Problem with changing sides
« Reply #8 on: 18 Aug 2006, 17:30:34 »
I too have struggled with getting one unit to kill another at a time and place I want.  I gave up. Solutions I have used:

In cutscenes when you control the camera.  Only have the victim on camera, create the sound of a gun and create a bullet or two within the body of the victim.  Previously have a shot of the assassin to set the context. 

In mission: (1) Have the assassin at a location the player cannot see.  Give the assassin a "fired" EventHandler that creates bullets in the victim - or setDammages the victim.  Execute a doFire command on the assassin.  The reason he should not be visible to the player is that he will shoot in the air.  By using an EH you ensure the effect happens when he fires and not before.

In mission: (2) Have the victim and assassin out of sight of the player, use voices to set a context.  Create the sound of bullets and setDammage the victim.

GavinP

  • Guest
Re: Problem with changing sides
« Reply #9 on: 18 Aug 2006, 19:13:22 »
@Mr Peanut - Like i said further up, i was clutching at straws by then, and wondered if it was because I'd fouled up the groups somehow for east and west. Basically like you say, trial and error.

@Thobson - Unfortunately, this is going to be a MP mission, so there's no way around it. I'm going to have to figure something else out I guess. I have tested the changing sides in front of my player, from a civ group to an east group, and myself as west, and he definately shoots me! It has to be possible someway. Surely. Please. God.

GavinP

  • Guest
Re: Problem with changing sides
« Reply #10 on: 18 Aug 2006, 19:43:50 »
I'm coming to the realisation that you can't change a units side. Yes, you can change its group from one side to another.

I just tried the following

Set a trigger activation anybody.

activation=[psuedoEastUnit] join RealEastGroup;[psuedoWestPlayer] join RealWestGroup

I had a west soldier as player (psuedoWestPlayer)Rank Private grouped to a civilian sergeant

I had a East soldier as player (psuedoEastUnit)Rank Private grouped to a different civilian sergeant

I had a west soldier Rank Major with RealWestGroup=group this in his init
I had a East soldier Rank Major with RealEastGroup=group this in his init

I then walked into the trigger.

Results? psuedoEastUnit hared off to reform with the RealEastGroup while My new officer told me to rejoin formation.

I went a step further, since the above had obviously changed the groups correctly. This time in the trigger I added
[psuedoWestPlayer] join grpNull;[psuedoEastUnit] join grpNull
and reran it.

Results? psuedoEastUnit stays where he is, and I don't get told to rejoin. I then walk infront of psuedoEastUnit. He stands, patiently waiting for something to happen. I shoot ground. He lays down, then gets back up and resumes waiting for a bus or something. >:(

Analysis - Changing groups does not seem to make the blindest bit of bloody difference. :banghead: :banghead: :banghead:

GavinP

  • Guest
Re: Problem with changing sides
« Reply #11 on: 18 Aug 2006, 19:58:45 »
Sometimes I find that if people are going to make smartarse comments, its better to a) remove their head from their ass and b) Actually read the thread.
Hi,

Thanks for the help. I've managed to remove the errors. I had indeed f'd up the naming of civ2. Instead of the loon, i'd called the group.  I don't really want to use setcaptive because basically the mission is going to be escorting the west general to meet east general (gen2) who will shoot civ2 infront of west general, and then because he's east again, shoot the west general. All his escort will of course turn east and open up merry hell.

However, the following still won't make gen2 shoot civ2.

Code: [Select]
[gen2] join ge1;gen2 addMagazine "tokarevmag";gen2 addWeapon "tokarev";[civ2] join w1;[civ2] join groupnull;[gen2] join groupnull;gen2 selectWeapon "tokarev";ge1 reveal civ2;[b]gen2 doTarget civ2[/b];gen2 dofire civ2

GavinP

  • Guest
Re: Problem with changing sides
« Reply #12 on: 18 Aug 2006, 20:01:06 »
Addendum for those who want to know. :wave:

If the pseudoEastUnit begins grouped to a west unit, instead of a civvie, he shoots him. Therefore, one can only assume that the engine can't cope with two changes of group/Side?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Problem with changing sides
« Reply #13 on: 18 Aug 2006, 22:30:06 »
A quadruple post?

GavinP, could you please not do this, edit your previous post rather than make a new post immediately after your last.

It makes the topic easier to read and doesn't give the impression that you are having a conversation with yourself.   ::)


Planck
I know a little about a lot, and a lot about a little.

GavinP

  • Guest
Re: Problem with changing sides
« Reply #14 on: 18 Aug 2006, 23:45:13 »
Apologies. :(
 Didn't think of editing. Will do in future. :thumbsup: