Matthias Posted July 6, 2011 hi there I have no experience with acs scripting. But i want to ask how work these commands: If, mapvar, == 0 1 etc... For example this: if(mapvar1 == 1) { terminate; } mapvar1 = 1; Can someone explain me what it means? And do you know any webside I can read something about this? Only what I know is doom wiki but its too nutshell. Thankt a lot! 0 Share this post Link to post
Cat God25 Posted July 6, 2011 Try here: http://zdoom.org/wiki/ Lemme try to explain... "//" means a comment, and is ignored in a script. int cat=0; //this makes cat have a value of 0. Script 01 (void) { if(cat == 1) //If cat has a value of 1 { terminate; //stop the script. } cat = 1; //if cat doesnt have a value of one, it will now. } So... int soda=10; Script 01 (void) { if(soda==0) { Print(s:"Theres no more cans of soda left!"); terminate; } soda = soda - 1; GiveInventory("healthbonus",1); Print(s:"\cr*glug glug glug*"); } This script can be used for a Vending Machine, that gives out free cans of "soda" (Health Bonuses), but the machine will run out after 10 cans, and will desplay a message everytime its used after that. Hope thats helps. If not, try the link. 0 Share this post Link to post
Matthias Posted July 6, 2011 Cat God25 said:Try here: http://zdoom.org/wiki/ Lemme try to explain... "//" means a comment, and is ignored in a script. int cat=0; //this makes cat have a value of 0. Script 01 (void) { if(cat == 1) //If cat has a value of 1 { terminate; //stop the script. } cat = 1; //if cat doesnt have a value of one, it will now. } So... int soda=10; Script 01 (void) { if(soda==0) { Print(s:"Theres no more cans of soda left!"); terminate; } soda = soda - 1; GiveInventory("healthbonus",1); Print(s:"\cr*glug glug glug*"); } This script can be used for a Vending Machine, that gives out free cans of "soda" (Health Bonuses), but the machine will run out after 10 cans, and will desplay a message everytime its used after that. Hope thats helps. If not, try the link. Ok, i think I understand now :) thanks... And the "mapvar" doesn mean anything... that just a name of the variable and i can call it I want...right? 0 Share this post Link to post
Chopkinsca Posted July 6, 2011 enkeli33 said:And the "mapvar" doesn mean anything... that just a name of the variable and i can call it I want...right? Yep. It's best though to give it a name that sort of explains it's use. Now all you have to do is learn about variable scope! Very fun stuff. 0 Share this post Link to post
Matthias Posted July 6, 2011 ok thanks a lot! Now Im gonna make some good megawad! 0 Share this post Link to post