Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
crazyrobban

random player model

Recommended Posts

I've made a nice little 3-man mission for me and my friends, where one player is a civilian, and two players are US forces.

The civilian has IED's and can pick up weapons from caches I've placed.

The US forces has to destroy the caches, while trying to spot the enemy player among the ambient civilians.

Easy enough, and it's really fun to play, both as civilian and bluefor.

Though, after a few runs, bluefor knows exactly what to look for, since the civilian player looks the same each time.

So, can I at the start of a mission make the game choose one of the takistani civilian models and apply it to the player? Any way around it would be great!

Thanks! :)

Share this post


Link to post
Share on other sites

So how can you use that to change a player model and is it dedicated compatable?

Share this post


Link to post
Share on other sites

sorry i dont really know without doing search myself, playableunits is for MP, switchable is for SP.

http://community.bistudio.com/wiki/selectPlayer

SnowSky

Notes on locality issues with selectPlayer in multiplayer environments:

1) If you switch to a unit that's not local, control over movement will not be given to you immediately. For example, if you switch to an AI unit whose leader is a player, you will not be able to control the movement of your new avatar, as its control remains with the leader unit. You will however be able to look around while the unit walks automatically.

2) The identity of units are not transferred properly: If your old unit dies, this will count for your stats. Your old unit might remain identifiable as you (if you aim at the unit you see your own name). Your new unit will keep it's name, face and voice (face can be set dynamically, but name, voice and glasses have to be defined before mission start in the description.ext). When chatting, not the name of your original identity, but the identity of the transferred to person will show.

Those 2 Points were for ArmA I, I am currently analyzing the behaviour in ArmA II with version 1.08 + OA 1.57

So with ArmA II, you still have to keep an eye on locality (otherwise the AI will controll the unit you are), but there are cool possibilities now: if you do a "selectPlayer unitVarName",the unit takes your identity (with name, voice, face and glasses) - and your identity is also visible on other clients! But you have to remember that your old unit will stay with your Identity. Dies the old unit, the stats count it. An other thing you have to pay attention is the Death for your new unit - you have to register an EventHandler, otherwise you will stay in your dead unit, and also the MenuOption Respawn won't help you out! 3.Jan. 2011

besselinksjm

3) After switching to a unit that's not local, the unit will remain local to you after switching back. For example, if we have units A and B, and a client starts as unit A and unit B is AI under server control. If you switch to unit B, it will take some time, but eventually you can control the movement of unit B (see (1) above). Now if you switch back to unit A, unit B will remain local to you, the player. Any server-side scripts which try to execute local arguments -- such as doMove -- will fail.

kju

A working implementation can be found at A&S ProMode dev-heaven repo, acc guest, pw guest or at pastebin.

Be careful to learn all the pitfalls and things you need to take into consideration to have this working in MP.

Share this post


Link to post
Share on other sites

Interesting, so one could actually change their model in real time?

Share this post


Link to post
Share on other sites

I can offer a simple solution that's a bit of a bodge. It's just a mission for friends, right?

In the editor, make many civilian units of different apperance "Playable". Give all of them the same value in the Description field (e.g. "civilian"). Also set DisabledAI to 1 in description.ext.

When you play the mission multiplayer, there will be lots of units on the civilian side. Because you set the descriptions the same, it will not be obvious which is which. Have your civilian player pick one at random. Because you used DisabledAI, the ones not picked by a player will simply not exist.

There are three potential problems. Firstly, there's nothing to stop many players in the lobby choosing civilians, except your honour as friends. Secondly, the BLUFOR players might start to memorise the civilian's appearance by the civilian slot chosen (e.g. "if he chooses the second civilian slot, he's got a blue shirt"). Finally, having multiple civilians like this might play havoc with your IED scripts depending on how they're done.

Like I say, it is a bit of a bodge. Whether it suits you or not, I don't know.

Share this post


Link to post
Share on other sites

Great stuff everyone!

@nichevo

We're such a small group, so there's no trouble in your idea. I actually went and added four more civilians (including a woman, but that didn't work with the animations I used for the suicide bomb script.)

The scripts works fine, I just copied the init line from the original playable civ to all other added playable civs. There's really only one issue, but it's only present if there's more than one playable civ in-game. And it's a funny issue at that. Namely, the civs can activate each others suicide scipts. :D

I'll go with your solution Nichevo. Thanks! :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

×