I’m trying to make a little PVE game, nothing too fancy, but I’m not very well versed in Workshop functions. I know some basics but I could use some help.
I’d LOVE if someone could add my discord or something to talk me through it otherwise the main things I need to know is how to make a new spawn point and how to make one team spawn at various spawn points
Define various spawn location in an global array, examples (i’m using S for Spawn) :
S[0] : (12, 15, -45)
S[1] : (25, 56, 89)
S[2] : (-49, 3, -23)
Use a Player Variable to store the index of the location you want him to spawn (you can reuse S since it’s player variable now and not global). You can change it whenever you want to change the player spawn.
Add a rule :
Ongoing - each players
condition :
-in spawn room = true
action :
-teleport to S[s] (s = player variable S)
Edit : this action will tp everyone in the spawn room (even if they try to walk in to swap hero or heal)
You may want to add a player variable that become false when he die so you can check if it’s a respawn or not. So it will look more like this :
RULE 1
Ongoing - each players
condition :
-in spawn room = true
-Player variable = False
action :
-teleport to S[s] (s = player variable S)
-Set Player variable = True
RULE 2
When a player die
Condition : none
action :
-Set Player variable = False
1 Like
How do I create the different array locations? Or do you mean I should do like “global variable s (10, 15 -10), global variable T (11, 1, -12) etc?
Set global variable X at index
in value, choose “vector” and click on the camera (it put your current location or you can enter it by hand)
And then put the index (0, 1, 2, 3)
After, to go look for a value you put in you have to use :
Value in array( Varable X ( index Y)))
Is it possible to type the direct scriptwork? I’m trying to figure it out but I can’t seem to get it right
sorry to be a hassle
Here you go : ZK02K
You got 4 rules :
Global Init = Locations of spawns
Player Init = Setup spawn location variable
Tp on spawn = it say all
Die reset = reset the rule above when dying
You have to change the values in the first rule because vector(0,0,0) oftenly end up in the void
1 Like
Okay so that’s all downpat, how do I make it so it will spawn in a range of say 3 different spawn points? Or is that not possible?
I copied that script and it takes me back to the same spawn point each time
Yeah that’s because you need to modifiy the player variable S to change the spawn location.
If you want a random respawn every time you die just add in the “Die reset” rule :
actions
{
Set Player Variable(Event Player, S, Random Integer(Min, Max));
}
Change Min to the 1rst index of the spawn you want them to go
Change Max to the last index of the spawn
1 Like
Awesome! I’ve got it working ! Thanks so so much
One other thing, is there a way to spawn say 5 Bastion units but give only one their ultimate?
Can you describ it a bit more ?
Like do you want the bastion to have AI or just dummy bots ?
Do you want the bastion to move or stay in place ?
Do you want them to be always here or just temp ?
etc …
Dummy bot Bastions with one of them having their ult
Would you want one Bastion at any moment to have an ult ready? Like if the one with 100% charge dies, another Bastion would get it?
More like 1 in every 15 or so bastions would have one
So to create bot you need :
Create dummy bot ( hero(X), team(X), slot(X), pos(X))
X are just value you need to define
And to se ultimate you can use :
Set ultimate percentage ( Player(X), Charge(X) )
To set it to bot you need to use “player in slot” for player(X)
And put 100 in “charge(X)” for it to give the full ult
1 Like
You’ve helped so so so much! Thank you!
Hopefully my last question, how would I make it so a particular thing happens every __ amount of points?
I’m trying to make it so every 15 deaths on the enemy team a unit is swapped with a different one.
I have the actions and everything right, I just need to know what condition will make it so it happens every time Global Variable (M) is a multiple of 10
You need to use the modulo function, it return the rest of the division of X/Y. So if it’s equal 0 that mean the X value is a multiple of Y
So put this in you condition :
modulo(Global_Variable, Every_X_Time) = 0
That didn’t work
It made them spawn instantly.
Can you send the rule ? becaus you probably did something wrong
Edit : i just realise it may come from the fact that the “force hero” made ppl instant respawn (if you’r using it)
Okay I fixed that but now it’s starting to stuff up.
So essentially I start off with a spawn of Brigs
“Condition: Is Game in Progress = True
Action: Create Dummy Bot(Hero(Brigitte), Team 2, 1, Value in array (Global variable(s) min(0, 8)) Vector 0, 0, 0”
Which works fine, I have 6 Brigs spawn in slots 0 - 5 on team 2. That works
Then I have Modulo rule (which works) for each other hero I want to spawn in. I have no problems with either Genji or Hanzo, which are in slot 1 and 2, but Rein and Moira, in slots 3 and 4 won’t respawn.
Condition
Modulo (global variable (m), 10) = 0
Action
Destroy Dummy Bot (team 2, slot 1)
Create Dummy Bot (hero(genji), team 2, 1, value in array (global variable)(s), min(0, 6)) vector (0, 0, 0)
And i have a respawn mechanic that works for genji and hanzo but it won’t work with rein or moira. It actually just deletes the slot of the dummy bot.
Actions:
Destroy dummy boy (team 2, 3)
Create dummy bot (hero(brigitte), team 2, 3
It’s the exacr same rule I used with hanzo and genji but it won’t work for some reason. Idk why
Can you send a share code ? Because i can’t really see where is your mistake