Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.

In the meantime please join the new Discord Server!

If you have any questions please e-mail me through the Platinum Arts website.

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.
Locked
User avatar
Sircameron
Member
Member
Posts: 62
Joined: March 6th, 2012, 9:13 pm
Name: Cameron
Location: Indiana

Adding custom variables

Post by Sircameron »

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

Post by chocolatepie33 »

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

Post by Sircameron »

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

Post by thevermin8tor »

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

Post by Sircameron »

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)
Locked