OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: evil on 14 Apr 2004, 19:48:18

Title: Execing script in createunit
Post by: evil on 14 Apr 2004, 19:48:18
Can it be done?

"OfficerE" createUnit [_loc, eastgroup1, "this allowfleeing 0; [this] exec "script.sqs"",1] doesn't work.  The only way around it I see is to give the guy a name and then execute it, like this:

"OfficerE" createUnit [_loc, eastgroup1, "this allowfleeing 0; badguy=this",1]
[badguy] exec "script.sqs"

I can't do it like that though, because the createunit script will be run more than once, and you can't have two guys named the same thing!

Any ideas?
Title: Re:Execing script in createunit
Post by: Jezuro on 14 Apr 2004, 19:59:38
I think it's caused by the obvious quotes problem  ;) Try this:

"OfficerE" createUnit [_loc, eastgroup1, "this allowfleeing 0; [this] exec ""script.sqs""",1]

or

"OfficerE" createUnit [_loc, eastgroup1, "this allowfleeing 0; [this] exec {script.sqs}",1]
Title: Re:Execing script in createunit
Post by: evil on 14 Apr 2004, 20:47:45
Works great.  I didn't know you could get around the quotes problem.  Thanks.