Help needed: giving units to players in MP scenario

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
deserter
Art Contributor
Posts: 291
Joined: September 12th, 2005, 9:48 am
Location: Finland

Help needed: giving units to players in MP scenario

Post by deserter »

Let's say that I wanted to do this for a MP scenario:
Give certain unit for every side depending on corresponding side's faction.
For example if player two was rebel I would give them a Wose. (in the point (x,y))

Where could I find the needed information or would someone have time to tell me how to do this. I'm not very familiar to WML see.

Thank you.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

I don't think this is something that can reliably be done. You could check for the type of the side's leader (if the leader is one of Swordsman,Lieutenant,Pikeman,... the side would have to have Loyalists), but this isn't completely reliable, since for example in the default era, both Loyalists and Rebels have White Mage as a leader option. I can't think of any way to determine the side's faction as long as the player gets to choose it himself.

Theoretically, if the extra unit wouldn't need to be placed in the beginning, you could see what units the side recruits in addition to checking the leaders type, which would let you very, very likely determine the player's faction with a lot of [if]'s. This is completely theoretical rambling though, not a solution for you.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

I haven't looked at Wesbowl's code for a long time, but it probably has a mechanism for determining this.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

turin wrote:I haven't looked at Wesbowl's code for a long time, but it probably has a mechanism for determining this.
Yes, a mechanism like I described. I chose rebels with a white mage as a leader, and it gave me loyalist units to play with. So yes, it almost always works with the default era.
deserter
Art Contributor
Posts: 291
Joined: September 12th, 2005, 9:48 am
Location: Finland

Post by deserter »

Thanks for help.
I had already checked the Wesbowl's code without understanding it.
Then I managed to do a very-clumsy-but-working version and then I tried to understand the Wesbowl-code and managed that. Then I tidyed my own code and now it's much better. I ended to a lot like Wesbowl solution wich propably isn't a surprise.

zookeeper:(Why wasn't it a solution for me btw?)
Post Reply