Jump to content
Sign in to follow this  
aiki

Init string in createunit

Recommended Posts

Hi,

How to parse a string inside another string, like "this setBehaviour "SAFE" " in CreateUnit ?

CivG = Group Civ1

_pos = getpos Ap

"Civilian" CreateUnit [ _pos , CivG, "this SetBehaviour "SAFE"", 0.5, "CAPTAIN"]

this last line is wrong (Init field can't to be correctly interpreted : "This SetBehaviour " is the string and: SAFE"" is a operand )

Is there a way ?

Thanks.

Share this post


Link to post
Share on other sites

Use double quotes for SAFE:

"Civilian" CreateUnit [ _pos , CivG, "this SetBehaviour ""SAFE""", 0.5, "CAPTAIN"]

This was introduced in some patch. It can be used for all strings, e.g. within a ForEach command.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×