Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Matthias

ACS - If mapvar

Recommended Posts

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!

Share this post


Link to post

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.

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×