So i need to have a variable that is specific to each player. But not only that i need it to change based on the region it is in. Example: My marine walks near a door, the door has a cost of like 350. So the variable changes to 350. Now my marine walks to the next door, the door cost 400 to open. The variable changes to 400. I am doing this because i have a collapsible menu that has some stats and a yes and a no button. As you approach a door i would like the price to appear so the person knows whether they have enough money to open it. Can someone help me or show me an easier way?
Make the varriable an array
Variable Integer[5] = 0 if you have 5 players on your map.
Then in your trigger refer to this variable as variable[(Triggering Player)]
Example:
Variable - Door Cost - Integer[5] = 0
Event - Any unit enters region (Door Cost 350)
Action - Set variable Door Cost[(Triggering Player)] = 350
So i created an array of 8, all of them integers... I assigned them each a value of zero to start out with. When they enter a region near a door, the value of variable[triggering player] is changed to the door price. In my dialog box i wrote in the text section "variable[triggering player]". this recalls the value of the most recent door for that player... i get some error about the array... i dont know how to explain it anymore. any help?
my dialog box is a collapsible dialog box with two buttons
and when i go close to a laser door, i need the value for the cost of the door to change.... it has to be an array of costs, because players could be next to different doors.
like how do i update my dialog box? some people have score dialog boxes with numbers changing all the time, if i change a variable it doesn't update in the dialog box
Not 100% sure, don't see a "Dialog - Show" action anywhere in your trigger.
Maybe that's why it's not updating, you need to redraw the entire dialog when you change something.
I don't have any experience with Dialog that never go away like yours.
Is there a way to just 'refresh' the bottom of my dialog box, or, if not, the whole thing at once? i keeps wanting me to refresh individual parts. how can i refresh the whole thing?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So i need to have a variable that is specific to each player. But not only that i need it to change based on the region it is in. Example: My marine walks near a door, the door has a cost of like 350. So the variable changes to 350. Now my marine walks to the next door, the door cost 400 to open. The variable changes to 400. I am doing this because i have a collapsible menu that has some stats and a yes and a no button. As you approach a door i would like the price to appear so the person knows whether they have enough money to open it. Can someone help me or show me an easier way?
thanks for your time
-ndy
Make the varriable an array
Variable Integer[5] = 0 if you have 5 players on your map.
Then in your trigger refer to this variable as variable[(Triggering Player)]
Example:
Variable - Door Cost - Integer[5] = 0
Event - Any unit enters region (Door Cost 350)
Action - Set variable Door Cost[(Triggering Player)] = 350
So i created an array of 8, all of them integers... I assigned them each a value of zero to start out with. When they enter a region near a door, the value of variable[triggering player] is changed to the door price. In my dialog box i wrote in the text section "variable[triggering player]". this recalls the value of the most recent door for that player... i get some error about the array... i dont know how to explain it anymore. any help?
text(variable[triggering player]) maybe? I know you need to turn the int into a string via the text function. might be the problem.
i am!!!!
see?
and how do you update table values? i can change the variable but somehow i have to redraw the label... how do i do that?
I tried doing something similar for the Level Up menu dialog in my game.
I converted the integer to text in the Local Variable for the trigger.
I'm not familiar with the type of Dialog Menu your using, mine is a very basic Button menu.
I enabled this to test variable shows up fine.
I currently have this disabled since I don't know how to increase a Behavior Attribute via a trigger.
my dialog box is a collapsible dialog box with two buttons
and when i go close to a laser door, i need the value for the cost of the door to change.... it has to be an array of costs, because players could be next to different doors.
like how do i update my dialog box? some people have score dialog boxes with numbers changing all the time, if i change a variable it doesn't update in the dialog box
Not 100% sure, don't see a "Dialog - Show" action anywhere in your trigger.
Maybe that's why it's not updating, you need to redraw the entire dialog when you change something.
I don't have any experience with Dialog that never go away like yours.
Is there a way to just 'refresh' the bottom of my dialog box, or, if not, the whole thing at once? i keeps wanting me to refresh individual parts. how can i refresh the whole thing?