Multiplayer compatibility question
Moderator: Moderators
-
razac920
- 2nd Lieutenant

- Posts: 365
- Joined: Sun Jan 16, 2011 12:42 am
Multiplayer compatibility question
Can you use SetClassProperty to change PointsToUnlock on a class midgame?
- AnthonyBF2
- Sith

- Posts: 1255
- Joined: Wed Aug 21, 2013 3:55 pm
- Projects :: PS2+PSP Overhaul
Re: Multiplayer compatibility question
PointsToUnlock is sort of a visual thing, it has to match both people for it to work right.
If client has free specials but host defines a value, then they will spawn as soldier until they actually have the points for the specials.
If you want all people to have the specials at once (or lock it at once) you could add a custom FC button to do that function so that the client side will then match the host. They would have to press the custom button on their own, you can probably tell them to do this using ShowMessageText.
If anyone has a special currently and the points are raised, it will not work until they've died and tried to rechoose that class.
Bots how ever use specials any time they wish.
If client has free specials but host defines a value, then they will spawn as soldier until they actually have the points for the specials.
If you want all people to have the specials at once (or lock it at once) you could add a custom FC button to do that function so that the client side will then match the host. They would have to press the custom button on their own, you can probably tell them to do this using ShowMessageText.
If anyone has a special currently and the points are raised, it will not work until they've died and tried to rechoose that class.
Bots how ever use specials any time they wish.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Multiplayer compatibility question
Yes you can. Just make sure both the clients and server make the change, as well as new players joining mid game.
-
razac920
- 2nd Lieutenant

- Posts: 365
- Joined: Sun Jan 16, 2011 12:42 am
Re: Multiplayer compatibility question
And how does one ensure that both the clients and server make the change? It's not like the server and clients are running different LUA scripts?
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Multiplayer compatibility question
Well then you're likely good. You can have the server and client run different scripts. I don't know what you're doing.
- AnthonyBF2
- Sith

- Posts: 1255
- Joined: Wed Aug 21, 2013 3:55 pm
- Projects :: PS2+PSP Overhaul
Re: Multiplayer compatibility question
I may not have been clear, you can build a custom fake console command that lowers or raises the points for your characters.
You can then run show message text to tell the player on the screen they should pause and press the custom FC command so that their special's points will then match host.
If client sees a limit, and host has free, player still has to earn points
If client has free and host defines a value, client will spawn as first unit on their team until points are earned.
Allowing the client side to think the points have changed(FC command)will match the host.
You can then run show message text to tell the player on the screen they should pause and press the custom FC command so that their special's points will then match host.
If client sees a limit, and host has free, player still has to earn points
If client has free and host defines a value, client will spawn as first unit on their team until points are earned.
Allowing the client side to think the points have changed(FC command)will match the host.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Multiplayer compatibility question
I understood that, but it's way overkill depending how it's being used. You can use it in ScriptInit or ScriptPostLoad without needing a FC command. Say you want to lower unlock points every time a CP is captured. Using SetClassProperty() in the OnCaptured event call back will update the values for both clients and server because both of them run that code.
The main issue is for people joining mid-game. They wouldn't have seen the CP captured event (or your server message) and thus their unlock values would be different (I'm fairly certain but never tested it). However depending on the mission that might not matter.
The main issue is for people joining mid-game. They wouldn't have seen the CP captured event (or your server message) and thus their unlock values would be different (I'm fairly certain but never tested it). However depending on the mission that might not matter.
