Home   Help Search Login Register  

Author Topic: Setting player's face to AI  (Read 1765 times)

0 Members and 1 Guest are viewing this topic.

B-2-0

  • Guest
Setting player's face to AI
« on: 03 Mar 2004, 17:28:22 »
I just wanna point out to the mod's that even though this post contains the words 'Intro' and 'Cutscene' a few times, the problem is not actually related to the intro :P ;D

Scenario: I have made a co-op and am working on the intro/cutscene which i want to consist of the players getting in the chopper.  Now the players can't actually get in the chopper for my intro/cutscene so i need to simulate them with AI and then swap them with the real players mid-flight obviously.

The Problem: Is there a way to set the AI faces to correspond with the player's faces.  I am thinking along the lines of link in CTF when u cap a flag it says '[your name] has capped the flag' or whatever........is it possible to return the name of each player like this and then link to the corresponding custom face in the client's tmp folder and set each one to an AI??

What i would also need to do is return how many players are on the map and set the number of AI accordingly....but i will cross that bridge when i come to it.

Thanxs in advance....here's hoping :)

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Setting player's face to AI
« Reply #1 on: 03 Mar 2004, 22:48:01 »
'lo Bravo,

I'm not sure, if setface done locally, will be visible
global, but if so, the following could work.
If it's not visible global, forget the following  ;)

You'll have to give each of your playable units an individual
name (like: wp1, wp2, wp3)

Then you would need to name their intro-stuntmen individually
(like: intro_wp1, intro_wp2, intro_wp3)

Now you can use these names as referbacks for your faces.

e.g: ?(wp1 == player): intro_wp1 setface "custom"
?(wp2 == player): intro_wp2 setface "custom"
?(wp3 == player): intro_wp3 setface "custom"

This way, the intro guys would get the custom faces from
where their corresponding player unit is local.

As i said, there's still the possibility that if: intro_wp1 gets
the custom face of B20, locally on B20's pc, this comand would
only affect B20's pc, so that nobody else would see that.

You'll have to try it out, as i weren't in the need for that yet.

If it doesn't work, the only way around would be to overrule
their player's face by setface command, to give them faces
from the game, and to use the very same faces for the intro
guys aswell.

~S~ CD

Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Setting player's face to AI
« Reply #2 on: 04 Mar 2004, 02:41:44 »
This way, the intro guys would get the custom faces from
where their corresponding player unit is local.

As i said, there's still the possibility that if: intro_wp1 gets
the custom face of B20, locally on B20's pc, this comand would
only affect B20's pc, so that nobody else would see that.

setface using "Custom" will only return the local Players "Custom" face
So each client will see his own custom face only and nobody elses

It is possible to set a flag image using a .jpg outside the mission folder or mission.pbo as long as it is in your Codemasters OFP folder
However i have not been able to do the same to an ai's face using the setface command.
I even tried creating an identity and tried setting the "Face" parameter to the linked "face.jpg in the users folder Didnt work, although setting a flag texture to the face.jpg in the users folder did work

Odd seeing your custom face flying on a flag

So it is all to do with the way the setface command works and what it calls for


If anybody can call the "Face.jpg" and load it onto an ai's face, then we MAY be able to  create  a script that will load up a different face for each of your ai's by calling on the name of a unit in an array, and then linking the jpg to that players folder in the clients temp folder (PERHAPS)

by something like


soldierarray = [w1,w2,w3,w4]
actorface = format ["\users\%1\face.jpg", name (soldierarray select 0)]
AIunit setface actorface


This is of course all theory ;D
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Setting player's face to AI
« Reply #3 on: 04 Mar 2004, 12:50:22 »
Terox, if you take a deeper look into my description, you'll
see that i did not mean to use setface globally for each unit
on each pc.

The only thing i am not sure about is:

If i use setface "custom" for an AI unit, locally on my pc -
will you see the same thing on your pc?

The question is: does setface need to run global or is it ok
to run that command local only (like createVehicle).


If it's ok when running local, everything's fine with my method.
If not, well then you already pointed into a good direction;

Remember that you can also see the custom faces of other
players, as when connecting to a server everybody has to
automatically download stuff like custom faces or sounds.

So your idea about the face access by name would make
sense too.

But i think one should try out what i suggested first, before
going more complicated ways.

:edit - ouch - i just thought again about the setface command
running local or global.

If it only needs to run local, then there's off course still the
chance that each individual player's custom face will be used.
I got what ya mean Terox. But it's still worth a try before
being sure about that i think.

I can't remember into which folder the player's stuff like
custom sounds and faces will be downloaded (temporarely),
but it could be possible to use this one for the faces - if getting
to work.

~S~ CD
« Last Edit: 04 Mar 2004, 12:55:25 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Setting player's face to AI
« Reply #4 on: 04 Mar 2004, 23:44:04 »
I seem to recall that in multiplayer the other players downloaded faces and sounds go in the MPMissionsCache folder.

But maybe my memory is faulty.



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

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Setting player's face to AI
« Reply #5 on: 05 Mar 2004, 17:46:44 »
the problem isnt where it goes too, as we can call from any folder in the OFP installation folder

The problem lies with what the command setface calls for

eg

setface "Face1"
setface "Custom"

You can setface using the players custom face easily
However i have not been able to setface using a face.jpg, which is what "Custom" eventually calls for

I would imagine that for setface to call another clients "Custom" face, (Lets call this client X to avoid confusion) then you would have to call for that clients custom face in the X folder that is created in the temp folder of all clients

This is where we ground to a halt.
I can call the face.jpg from the X folder in the temp folder and load the image onto a flag, but cannot draw it on an AI face using setface

Due to what setface actually calls for


So if anybody knows how to load a face onto a player using a .jpg, then the problem will be solved
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123