Adding custom variables

Having issues not related to a specific Sandbox game mode? Get help here!
Please also read the rules for support when posting support requests.
Failure to comply with the forum rules may result in your topic being locked without resolution.
User avatar
Sircameron
Member
Member
Posts: 62
Joined: March 6th, 2012, 9:13 pm
Name: Cameron
Location: Indiana

Adding custom variables

Postby Sircameron » March 6th, 2012, 10:27 pm

So ive been experimenting with the scripting system, and i was wondering if there's a "putvar/getvar" style of command that would let me add my own variables in a .cfg file? Im not very familiar with the functions and commands of cubescript.. I was able to find a page on it, but it was rather confusing.. So any help would be greatly appreciated.

basically what im trying to do is when a player uses and item, spell, etc it would put a number in a file (1+1) i.e pedometer, or counter

oh and i'm using the rpg mode. sandbox v2.6

chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Adding custom variables

Postby chocolatepie33 » March 9th, 2012, 6:52 pm

this is somewhat off topic, but it may be useful, 2.7.1 is the most recent release, I believe that between 2.6 and 2.7 the RPG system was redone and is much better than before, if you're using RPG mode I'd upgrade.
Julius wrote:Contribute to http://www.opengameart.org NOW!

Save the wiki!

User avatar
Sircameron
Member
Member
Posts: 62
Joined: March 6th, 2012, 9:13 pm
Name: Cameron
Location: Indiana

Re: Adding custom variables

Postby Sircameron » March 10th, 2012, 4:33 pm

Apparently i am using 2.7 sorry for the confusion there.. Yea ive noticed that some triggers work in a very similiar fashion in what im trying to do. I still havent figured it out, and im almost positive at this point that its not possible to do what im attempting.. Still loving the engine.. Looking forward to uploading some of my work here soon :)

User avatar
thevermin8tor
Member
Member
Posts: 7
Joined: May 10th, 2011, 3:37 am
Name: Hannam
Location: New Zealand
Contact:

Re: Adding custom variables

Postby thevermin8tor » March 28th, 2012, 1:22 am

2.71 looks really good, downloaded it from the website, installed it, but couldn't save the map I created to c:/programfiles____fps/packages folder so uninstalled it and downloaded,installed then ran 2.61 and installed it in the first recommended folder c:/dowmloads and it was all good. But I think 2.71 looks way better.Any one know how to fix the "save" problem I had with 2.71?
And can I create a map and load other sprites or characters and objects into it, as I feel some of the objects look too amateurish.
How can I create a game start point? As I created RED CLIP barriers to limit access to further areas of the game, but when i save and then reload the map, I'm always on the other side of it even if I make the walls sky high!

User avatar
Sircameron
Member
Member
Posts: 62
Joined: March 6th, 2012, 9:13 pm
Name: Cameron
Location: Indiana

Re: Adding custom variables

Postby Sircameron » March 28th, 2012, 3:28 am

Well i dont know... If you want to know how to add custom variables and do addition with them the code is

Code: Select all

 //put in variables.cfg
var_name =(r_global_new 0)

//add to your script, trigger,etc
r_global_set $var_name (+ (r_global_get $var_name) 1)


Return to “Sandbox General Support”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests