Home   Help Search Login Register  

Author Topic: Changing unit's type  (Read 580 times)

0 Members and 1 Guest are viewing this topic.

Peter haroski

  • Guest
Changing unit's type
« on: 19 Dec 2004, 11:59:28 »
How I can change unit's type, examble from EAST:  Soldier --> Spetz Natz, with a script, used examble in MP missions parameters

In my mission, there will be one player is V.I.P, and he muist escape trough the labyrint, where polices are waiting. One of  the parametres will tell, what kind of unit V.I.P is.

So, I need command to change players unit type

Sorry my english

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Changing unit's type
« Reply #1 on: 19 Dec 2004, 12:07:20 »
Your English is much better than my Finnish so do not worry about that.

I am afraid you cannot change the type of a unit within a mission.  But I am sure you can do what you want in another way.  Could you explain a bit more about why you want to change the type.
« Last Edit: 19 Dec 2004, 12:07:42 by THobson »

Peter haroski

  • Guest
Re:Changing unit's type
« Reply #2 on: 19 Dec 2004, 12:24:44 »
Well, my point was, that there will be  many "difficulty levels", like
1.Police
2.Soldier
3.Spetz Natz
4.General

I meant, that when I select one of these, it would change unit type of hunter.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Changing unit's type
« Reply #3 on: 19 Dec 2004, 12:37:33 »
So you have several possible units and depending on which you pick in MP you want to have different enemies, and those enemies are possibly other humans?

It is this last point that I have a difficulty with.  If they are AI then you might be able to do it by creating all the possible enemies, but setting the condition of presence based on the player type.

Something like

vehicle player == vehicle name_of_one_of_your_VIPs

Or you might try deleting the enemy units after the mission starts based on the above condition.

Syntax etc. not guaranteed.

I am not sure how this works if the units are 'Playable' rather than AI though.
« Last Edit: 19 Dec 2004, 12:40:09 by THobson »

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:Changing unit's type
« Reply #4 on: 19 Dec 2004, 18:08:18 »
Possible solution for AI enemy:

Step1:
titleParam1 = "DIFFICULTY";
valuesParam1[] = {1,2,3,4};
defValueParam1 = 1;
textsParam1[] = {"man","police","soldier","black-op"};

titleParam2 = ..
valuesParam2[] =..
defValueParam2 = ..
textsParam2[] = ..

These lines in description.ext will give you these options on setup-screen.

Step2:
Run  a script in init.sqs:
-For dedicated servers:[] exec "options.sqs"
-for non-dedi:?local player:[]ecex"options.sqs"

Step3:
Options .sqs:
#gametype
?(param1 == 1):goto "man"
?(param1 == 2):goto "police"
?(param1 == 3):goto "soldier"
?(param1 == 4):goto "black-op"

#man
..........
goto "exit"

#police
.........
goto "exit"

#soldier
........
goto "exit"


#black-op
........
goto "exit"



#Exit

exit


Step4:
U have to make 4 different groups of units (man,police,soldier,black-op) and give them a name.If U choose for example "police",then U have to delete all the other groups in options.
sqs (#police)


Player (HI)units cant be changed ingame.

U could also change the difficulty in weaponsetup of the hunter:
handgun-hunting rifle-M16-G36



http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

Peter haroski

  • Guest
Re:Changing unit's type
« Reply #5 on: 20 Dec 2004, 13:22:20 »
Jep, thanks from tips, I have you try something else...