Forum Discussion
couple of things i can think of..
1st, the x/y/z position i think is in relation to the whole map, not just the areas that are in bounds, so it may be trying to teleport a player to 30,10 x/y coordinates but that's out of the play area.
2nd, RandomReal allows for quite a few decimal places so it MAY be possible its teleporting beyond its limit, like it may allow for 3 decimal places but you spin up a random number like 1.665543, probably a low chance of that being the issue though
3rd, wouldn't happen 100% of the time but there's a chance of spinning a number under 1, this would still put the players collision box partially out of bounds.
I'd probably put my money on 1, if you display your co-ordinates on screen a lot of maps play areas start at about 50,50, so i'd set that as your lower limit for random real, it would also fix problem 3 if it ever occurs.
Also the create vector function uses x,y,z but it looks like your using your z variable in the y co-ordinate, wouldn't hurt functionally but could cause you issues if you get them confused
Lastly the ongoing event where your loadouts are, ongoing events need to have a condition and that condition needs to be toggled off at some point to be toggled on again. Another words if it happens at all currently it will only happen once.
Okay. Every smaller map has it's own unique coordinate... nice.
So.. how can i extract the player's default spawn coordinate from playerlocation?.
- kiki01hun4 years agoSeasoned Rookie
Okay. The teleport is working but i can't use bool varible as condition because if i set it to false or true, the error log says it gave a number to the and gate.
If i use this:
Setvariable enabled {true}
Rule
Condition AND {...}, {equals[getvar. enabled], [true]}
Error log says can't compare number with a bool.
- Matty101yttam4 years agoSeasoned Hotshot
default spawn co-ordinate can be found with getplayerstate-eventplayer-playerstatevector(set to position) put into an onplayerdeploy rule.
got a screenshot....or you can just copy paste the url up top of portal in here, can see it but cant change it that way.
- kiki01hun4 years agoSeasoned Rookie
https://portal.battlefield.com/experience/rules?playgroundId=cb9a9230-438c-11ec-b756-3cc39ff7e322
The teleport is working now.
The last thing, i can't set and get bool variables.About global vs player variables. I'll change that but first i have to figure out for just 1 player.