cubescript loop crashes game
#1
I made a cfg file called stuff.cfg

then inside of it I put:

i = 0
loop i 10 [ echo ("hello world") ]

but when I use /exec config\stuff.cfg to execute the script, the game crashes without any messages/warnings.

Any help is appreciated.
Thanks given by:
#2
Your syntax is wrong is all.

[cubescript]loop i 10 [echo hello world][/cubescript]

or

[cubescript]loop i 10 [echo "hello world"][/cubescript]

or

[cubescript]loop i 10 [echo [hello world]][/cubescript]

All do the same thing. By putting parenthesis around the string cubescript was trying to execute alias "hello world" which doesn't exist, and because it has whitespace prolly made the parser very angry. :P
Thanks given by:
#3
I tried this: loop i 10 [echo "hello world"]

and it still just closed the game after I tried to exec it.
Thanks given by:
#4
Try using:

[cubescript]/run stuff[/cubescript]

Instead of "/exec config\stuff.cfg"
Thanks given by:
#5
Nope, tried that and it doesn't work either. It seems like loops aren't working at all, any kind of loop that I try ends up closing the game instantly without notice.
Thanks given by:
#6
Hi,

If you type this in-game :
[code=cubescript]loop i 10 [echo "hello world"][/code]

Will it crash ?
Also what version of AC are you using ?

By the way, your user title is "AC Source modder";
If you're not using the official binaries, we can't help you unless you tell us precisely what modifications you brought to the code.
Thanks given by:
#7
IDK then, I just verified it working on 1104..

Contents of my /config/stuff.cfg:

[cubescript]echo STUFF.CFG EXECUTED
loop i 10 [echo hello world][/cubescript]

In-game I do:

/run stuff

Heres the output:
[Image: 2nav905.jpg]

What operating system do you use?
Thanks given by:
#8
I got a fresh new copy of 1104 that is 100% un-modified. The version I modified for testing is in another folder, I don't make cfg for that versions. Maybe I will try to re-download 1104 again and install it, then try to doing stuff.cfg again
Thanks given by:
#9
Lee, piece of advice, don't EVER use this on public servers!
Thanks given by:
#10
LOL, I wasn't going to, but I'm trying to learn cube script and loops is part of it, so I wanted to check it out.
Thanks given by: