Jump to content
Sign in to follow this  
crashdome

Okay, I found bug in Createunit command...

Recommended Posts

Ohhhhhh.....  I'm so happy...  Spent hours with this and finally found root of problem.

OK, I'll try and explain without writing a book about it.

When Using the Createunit command to make units for the player to control via a script there is a BIG BUG in the init line value. For example, a script such as:

"SoldierWB" createunit [pos,group player,"dostop this",1,"PRIVATE"]

exit

 - does not work and causes crash to desktop

however:

"SoldierWB" createunit [pos,group player,"randomtext",1,"PRIVATE"]

exit

- causes error: exit|#| local variable in global space

Hmmmm.. ok.. problem must be that the init line in that array is never finished.. i.e. the second " is never considered to end the value such as:

randomtext",1,"private"]exit

is considered to be everything in the init line(to my knowledge)

So even when you put "" it works, but not correctly and can cause a crash later on when ordering units around.

So how do we get around this?

you can live with the defaults and keep it short:

"soldierWB" createunit [pos,groupname] - this works with every script I tried but you must live with 0.5 skill levels and Privates OR - I also tried this:

_testarray=[pos,group player,"",skill,rank]

"soldierWB" createunit _testarray

exit

- this also worked everytime!

HOWEVER:

by adding "dostop this" instead of "" into _testarray I still got booted to desktop. So we are going to have to live without init lines until they find the problem and fix it (or someone else thinks of something).

I am not sure why,

"SoldierWB" createunit [pos,group player,"",skill,rank]

doesn't work correctly. Like I said, it seems to work but then shoots me to the desktop when I tell him to move to a tree or board a tank, but

"SoldierWB" createunit _testarray

seemed to work 100% when I left the init line "".

Can anyone comment on that or my other findings?

Share this post


Link to post
Share on other sites

I´ve experienced the same. The strange thing is this only happens when using CreateUnit within a script.

If used in a trigger the command works normally even with a nonempty Init-line

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  

×