- Joined
- Oct 23, 2006
- Messages
- 65
Ok, I'm trying to make an equation for my map (which is uber secret, but you will find out about soon). I have tomes which spawn in the middle every x seconds by having a trigger set a variable between 1 and 3 and selecting a random tome and placing it randomly in the region (this is designed to lure players into the center more). I want to make a formula so that x is scaled according to how many players are in the game (more players = faster tome spawn). When I go to do this in the 'Time - Every x seconds, I cannot seem to use my variable PlayersInGame (interger) in the equation in any way. I tried converting it to real, but couldn't get it to show up there either.
BTW: If anyone can quickly whip up a formula that spawns tomes at a minimum rate of 1 tome per 45 seconds with 12 players to a maximum of 1 tome per 75 seconds with 1 player (if you can make this two player, you get a cookie, that'd be awesome).
I kind of figured out a formula.
X = 45 + (3 x [PlayersInGame - 2]) Oops, that's backwards.
X = 75 - (3 x [PlayersInGame - 2])
Code:
Init
Events
Map initialization
Conditions
Actions
Set PlayersInGame = (Number of players in (All players))
Code:
TomeSpawn
Events
Time - Every X seconds of game time
Conditions
Actions
Set WhatTome = (Random integer number between 1 and 3)
If (WhatTome Equal to 1) then do (Item - Create Tome of Agility at (Random point in TheBowl <gen>)) else do (Do nothing)
If (WhatTome Equal to 2) then do (Item - Create Tome of Intelligence at (Random point in TheBowl <gen>)) else do (Do nothing)
If (WhatTome Equal to 3) then do (Item - Create Tome of Strength at (Random point in TheBowl <gen>)) else do (Do nothing)
BTW: If anyone can quickly whip up a formula that spawns tomes at a minimum rate of 1 tome per 45 seconds with 12 players to a maximum of 1 tome per 75 seconds with 1 player (if you can make this two player, you get a cookie, that'd be awesome).
I kind of figured out a formula.
X = 45 + (3 x [PlayersInGame - 2]) Oops, that's backwards.
X = 75 - (3 x [PlayersInGame - 2])