OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mercenary on 27 Aug 2002, 01:10:04
-
------------------------------------------------------
QUESTION 1
------------------------------------------------------
If I do:
[30] Exec "pushups.sqs";
in the initialization field, they only do 3 pushups (which is only 1 playMove "FXStandDip").
Why won't he do 30?
; pushups.sqs - Order a unit to do pushups
PushUpTotal = _this select 0;_i = 0;
PushUpTotal = PushUpTotal - 3;
? PushUpTotal < 1:PushUpTotal = 1;
goto PushUps;
#PushUps
@ _i != PushUpTotal
this playMove "FXStandDip";
_i = _i+1;
goto PushUps;
exit
------------------------------------------------------
QUESTION 2
------------------------------------------------------
Also with nearestObject, I tried to get the nearest dead soldier, but I simply can't. I tried:
nearestObject[this,Man]
nearestObject[this,"Man"]
for an alive soldier (doesn't work), and I tried:
nearestObject[this,!alive Man]
for the nearest dead man. Why wouldn't it return an object?
------------------------------------------------------
QUESTION 3
------------------------------------------------------
Is it possible to make a unit turn on full-auto mode on his weapon if he has a weapon with full-auto capabilities?
------------------------------------------------------
QUESTION 4
------------------------------------------------------
What do I do to define (in description.ext) a Resource for titleRsc ["RESOURCE_HERE", "PLAIN"]?
What do I do to define (in description.ext) an Object for titleObj ["OBJECT_HERE","plain"]?
-
2. if u have version 1.75 then it doesnt work anymore
3. unitname fire ["m60", "auto"]
4. look at the command reference
-
Thank you for your reply.
2.) What if I want to run to the nearest dead guy, what command would I have to type in?
unitname move !alive ???
3.) Thanks ;-). Also I believe that someone has told me if you order an RPG soldier to fire upon a Chopper/flying object the soldier would fire... but only in version 1.75 and will NOT fire and you CANNOT get him to fire in previous versions. Is this true?
; code will not work with less then 1.75?
unitname doTarget Chopper;
unitname doFire Chopper;
4.) I looked in the command reference all it says is:
Resource title - argument in format ["name","type", speed] or ["name","type"] If speed is not given, it is assumed one. Resource can be defined in description.ext.
Okay I know it can be defined in description.ext but how? I mean where do you search for the file (pic)?
-
; pushups.sqs - Order a unit to do pushups
PushUpTotal = _this select 0;_i = 0;
PushUpTotal = PushUpTotal - 3;
? PushUpTotal < 1:PushUpTotal = 1;
goto PushUps;
#PushUps
@ _i != PushUpTotal
this playMove "FXStandDip";
_i = _i+1;
goto PushUps;
exit
OK, first of all:
What is the first "goto pushups" for?
goto PushUps;
#PushUps
This doesn't make sense to me, because you order the script
to goto PushUps, while the next line is #PushUps.
This means, without the goto statement the script would
goto PushUps anyway.
Then it must be: goto "PushUps" instead of goto PushUps
That's the reason, why your script isn't looping, so it ends after the first PushUp round => so he doesn't do 30'
~S~ CD