The 3rd Age

The Wars of Arda

The Wars of Arda

A huge expansion for RotWK, adding multiple eras, numerous new factions and a full campaign.

Button for The 3rd AgeButton for The Dwarf HoldsButton for The Elven AllianceButton for Helm's Deep Last HopeButton for GothmogtheOrcButton for BFME+Button for The Four AgesButton for HDR HeadquartersButton for Middle Earth CenterButton for Project Perfect Mod

Become an affiliate!


Quick Lists

Top Rated Popular New Updated Last Comments Users

Register and log in to move these advertisements down

Executing scripts for only some players in a map

Tutorial for Battle for Middle-earth BFME, Battle for Middle-earth II BFME 2, Battle for Middle-earth II: Rise of the Witch-king ROTWK

Avatar of Bart


Category: Worldbuilder
Level: Intermediate
Created: Wednesday April 4, 2007 - 10:52
Updated: Wednesday April 4, 2007 - 10:59
Views: 3933
Summary: I will teach you how to execute scripts (like sounds or camera movements) for specific players in WB


Staff says


Members say




4 votes

These scripts can be used to do certain things, like playing sounds and showing texts only for one or more specific players in a multiplayer map. This is useful for those cinematic maps like Helms Deep (where you can, for example, make Theoden have a speech for Rohan players, but not for Isengard).

1. For each player you want to execute the events for, put down a RohanBaseDefenseFoundation (or another object which does nothing, but can be owned) outside of the map boundaries and give it a name (I will call it "PLAYER_ID_1"). Make sure it is owned by that player.
2. For each player, make a script folder, e.g. 'player 1 events'. Make this folder unactive
3. This script will activate the events for that player:
*** If ***
Unit 'PLAYER_1_ID' is owned by player '<local player>'
*** Then ***
Enable script 'player 1 events'

Of course you need one of these for every player with events.
4. Then you can put event scripts in the folder like:
*** If ***
*** Then ***
Play a sound
Show a message
Move the camera
Flash a command button

This will not cause out-of-sync errors. However, spawning units or something in these scripts probably will.
Note: Unlike what some people in the forum thought, this is not a solution to other out-of-sync errors


Display order: Newest first

Briggsby - Thursday May 31, 2007 - 8:48

Whoah now THAT is useful, thanks!

m@tt (Team Chamber Member) - Thursday April 5, 2007 - 11:59

I never knew about that local player script, I was looking for that to go with my ai fortress maps

ched (Team Chamber Member) - Wednesday April 4, 2007 - 12:03

I would love to see a more general scripting tutorial pop up, but hints are good :)

Go to top


"One site to rule them all, one site to find them,
one site to host them all, and on the network bind them."