• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Action "Game - Set Map Flag" broken?

Level 3
Joined
Sep 20, 2024
Messages
15
Hello! Here's another tricky problem I've been trying to solve for my coop maps but gave up:

To prevent cheating by changing options in lobby such as “Visibility - Always Visible” or “Handicap below 100% (to for instance 50%)” I would like to block or overwrite the lobby settings. In the wc3 editor the action “Game - Set Map Flag” exists but it doesn’t work at all!

I read a while ago on some random forum that the lobby settings cannot be changed on map initialization, they have to be loaded before/during loading screen using JASS or some other non-GUI way. Does anyone know how to do this? I want to force "Handicap" for all players to always be 100% and "Visibility" should be "Map Default".
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
JASSHelper used to have //! inject main and //! inject config, so I presume that functionality still exists in the modern WE. You can read about it in the JASSHelper manual:
Inject

Certain advanced users might use the world editor yet prefer to have more control over the map script, namely making their own main or config functions, the inject preprocessors allows to replace such functions.

The syntax is: //! inject main/config (...) //! endinject
For example:
JASS:
//! inject main
   //some function calls may go here

   // this places vjass initializations there, notice structs are first initialized then library initializers
   // are called
   //! dovjassinit


   //other calls may go here

   call InitCustomTriggers() //maybe you want to exploit that world editor function...
//! endinject
The dovjassinit preprocessor may prove very helpful, it is only necessary if there is no call to InitBlizzard in the custom main or if you need to control the position of such initializing of structs and libraries.

//! inject config works the same way only that there is no //! dovjassinit for that case.[/quote[
 
Top