Posts: 59
Threads: 21
Joined: Dec 2012
Thanks: 0
Given 0 thank(s) in 0 post(s)
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
Thanks: 13
Given 10 thank(s) in 8 post(s)
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
Thanks: 0
Given 0 thank(s) in 0 post(s)
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
Thanks: 13
Given 10 thank(s) in 8 post(s)
Try using:
[cubescript]/run stuff[/cubescript]
Instead of "/exec config\stuff.cfg"
Posts: 59
Threads: 21
Joined: Dec 2012
Thanks: 0
Given 0 thank(s) in 0 post(s)
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
Thanks: 18
Given 93 thank(s) in 51 post(s)
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: 59
Threads: 21
Joined: Dec 2012
Thanks: 0
Given 0 thank(s) in 0 post(s)
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
Thanks: 1
Given 11 thank(s) in 5 post(s)
Lee, piece of advice, don't EVER use this on public servers!
Posts: 59
Threads: 21
Joined: Dec 2012
Thanks: 0
Given 0 thank(s) in 0 post(s)
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.