OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Peter haroski 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
-
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.
-
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.
-
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.
-
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
-
Jep, thanks from tips, I have you try something else...