Basic Cubescript: Variables
#1
Hi all.

I come from a C++ background so I am wondering what syntax declares a variable that can be recalled later.

From what I've seen alias declares variables/commands and echo can print the contents of that but I can't seem to get that to work.

I like the Cubescript reference but I found it hard to learn the bare basics of the syntax from it.

E.G.


[cubescript]// This file gets executed every time you start AssaultCube.

// This is where you should put any scripts you may have created for AC.

alias test 67 //I'm trying to declare a variable and assign a value to it

alias testscript
[
echo test //I'm trying to print the value of that variable
]

docident testscript "Test Script" //I'm trying to document this so it come up with the description when I type it[/cubescript]

It would appear [ and ] are the equivalent of { and } and semicolons are not required?

When I create a variable how do I specify between strings, integers, and floats?
Thanks given by:


Messages In This Thread
Basic Cubescript: Variables - by Felix-The-Ghost - 27 Nov 11, 11:50PM
RE: Basic Cubescript: Variables - by V-Man - 28 Nov 11, 10:38AM
RE: Basic Cubescript: Variables - by V-Man - 28 Nov 11, 09:06PM
RE: Basic Cubescript: Variables - by V-Man - 29 Nov 11, 12:44AM
RE: Basic Cubescript: Variables - by V-Man - 29 Nov 11, 05:41AM
RE: Basic Cubescript: Variables - by V-Man - 30 Nov 11, 05:30PM
RE: Basic Cubescript: Variables - by V-Man - 01 Dec 11, 03:50AM
RE: Basic Cubescript: Variables - by tempest - 01 Dec 11, 03:17PM
RE: Basic Cubescript: Variables - by V-Man - 02 Dec 11, 12:55PM
RE: Basic Cubescript: Variables - by V-Man - 03 Dec 11, 07:37AM
RE: Basic Cubescript: Variables - by Bukz - 03 Dec 11, 01:11PM
RE: Basic Cubescript: Variables - by V-Man - 04 Dec 11, 06:43AM
RE: Basic Cubescript: Variables - by V-Man - 04 Dec 11, 11:21PM
RE: Basic Cubescript: Variables - by V-Man - 05 Dec 11, 10:37AM
RE: Basic Cubescript: Variables - by V-Man - 12 Dec 11, 10:27PM