Posts: 59
Threads: 21
Joined: Dec 2012
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.
Posts: 1,331
Threads: 44
Joined: Jun 2010
08 Mar 13, 11:17PM
(This post was last modified: 08 Mar 13, 11:19PM by Bukz.)
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
Posts: 59
Threads: 21
Joined: Dec 2012
I tried this: loop i 10 [echo "hello world"]
and it still just closed the game after I tried to exec it.
Posts: 1,331
Threads: 44
Joined: Jun 2010
Try using:
[cubescript]/run stuff[/cubescript]
Instead of "/exec config\stuff.cfg"
Posts: 59
Threads: 21
Joined: Dec 2012
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.
Posts: 1,981
Threads: 63
Joined: Jun 2010
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.
Posts: 1,331
Threads: 44
Joined: Jun 2010
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:
What operating system do you use?
Posts: 59
Threads: 21
Joined: Dec 2012
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
Posts: 1,318
Threads: 76
Joined: Apr 2011
Lee, piece of advice, don't EVER use this on public servers!
Posts: 59
Threads: 21
Joined: Dec 2012
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.