Variable question!

zedak

New Member
Reaction score
0
Hi guys, I'm new at using variables at my map, but I really want to learn how to use them perfectly and the first thing is this:

I'm trying to make "income" if you know what I mean, a periodic event that gives you money every 10 second and you'll be able to raise your income. For example, the income will be raised when you type "-income" in game.

I've tried to fix it by myself without help, but I don't really understand everything. I've done like this:


I made an Intreger variable (Do I need array, and what is array?) and I called it Income.
Income
Events
Time - Every 10.00 seconds of game time
Conditions
Actions
Player - Add Income to Player 1 (Red) Current gold

What is the action to "raise" the variable Income, or how do I do it? I don't really get it. If everything is wrong, tell me what I should do instead please. :)

I'm already waiting for an answer :p
 

jig7c

Stop reading me...-statement
Reaction score
123
have you set Income somewhere in your other trigger...
you have to set income to 10 somewhere in your trigger editor...

you are probably better off if you make the income an array,

map init
actions
set income[player number] = 10

and then lets say a player 5 types in -income and you only want his income to be raised by x amount...

event
player 1 types in -income as an exact match
player 2 types in -income as an exact match
player 3 types in -income as an exact match
so on...
condition
action
set income[player number of (triggering player)] = 10 + x

and then your trigger is good,

every 10 seconds of the game, add income to all player's gold
 

zedak

New Member
Reaction score
0
have you set Income somewhere in your other trigger...
you have to set income to 10 somewhere in your trigger editor...

Question; how do I set my variable Income to 10 in the trigger editor? I know how to set it in the "Variables window (CTRL+B)" but I don't know how to make a trigger like;

Events
Player - Player 1 (Red) types a chat message containing cs as An exact match
Conditions
Actions
Set the variable "Income" to 10
 

DiFm

New Member
Reaction score
35
Is the income gonna change? and is it gonna always be the same for some players or can every player have an individual income value?


If only 1 value through out all the game then you dont need variable at all.

If the same value for all players you dont need an array.

OtherWise set the array to as many individual income values there is.

example 12 for 12 players.
example 2 for Team 1 and team 2
 

jig7c

Stop reading me...-statement
Reaction score
123
I believe what he wants is in individual income for each player, up to x amount of players.... you would need integer array variable

If there are two teams with x players in each team, in which two incomes are neccessary, one for each team; then you would need an income integer array variable....

if it is only one income, for example every player gets 10 gold, then you don't even need a variable... but if each player gets individually 10 gold, and each player can change how much income they can get, then you need integer array variable....
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top