• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Turn on and off Gold sharing?

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2010
Messages
950
so i know theres flags you can set at map initialization to set resource sharing or not with players but i remember testing it before and it cant be turned on with a command any random time during a game.

Is there some way to do this im unaware of? Or is this just something that can truly only be done at map initialization and cant be changed..?
 
Alright i'm on this....

Maybe this is waht you want?
g1.jpg

I can't quite understand....
 
3GlikE has it yea but set it locked to off, but the prob is that trigger cant be turned on and off freely during the game, it has to be set in the map initialization..
i want to be able to change it to on or off with a command during game play. Anyone know how?
 
Yes, just make a trigger similar to the following:


  • Turn On Resource Trading
    • Events
      • Player - Player 1 (Red) types a chat message containing -resourcetrading on as An exact match
    • Conditions
    • Actions
      • Game - Set Lock resource trading to On
  • Turn Off Resource Trading
    • Events
      • Player - Player 1 (Red) types a chat message containing -resourcetrading off as An exact match
    • Conditions
    • Actions
      • Game - Set Lock resource trading to Off


I actually have never seen that action in the WE ever before, and I still haven't now. Don't know where you got that action from, but if that is what you want, then there you go.


Btw, I'm loving that signature, Bond009. :xxd:
 
no that wont work, thats my prob. it cant be changed with a command like that.. i was hoping someone knew of a back door way to do it maybe a line of jass script or something? maybe doing it locally for each player or something? idk
 
So you say that it can only be changed during the map init?
What about making a trigger like this:
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Wait - 10 seconds // I know that you want to control the time when to lock/unlock resources but that's a start, if this could work, then try to add action which adds to another trigger some event, event that you need.
    • Game - Set Lock resource trading to On
 
no that wont work, thats my prob. it cant be changed with a command like that.. i was hoping someone knew of a back door way to do it maybe a line of jass script or something? maybe doing it locally for each player or something? idk

Hmm... I really have no idea why that wouldn't work for you. That is a very simple and basic trigger. You could try other actions besides using commands, like hitting the escape button to toggle the Resource Trading.

I don't know JASS script, so I can't help you there.
 
I'm quite new to Jass, learned it yesterday, but tested this and it should work.
Add the JASS to the custom script code. When you are in the trigger editor click on your map and add this code:


JASS:
function  ResourceSharing takes nothing returns nothing
local string a = GetEventPlayerChatString()
if a == "-resourcetrading on" then
call SetMapFlag( MAP_LOCK_RESOURCE_TRADING, true )
call BJDebugMsg(" Resourcetrading is now activated" )
elseif a == "-resourcetrading off" then
call SetMapFlag( MAP_LOCK_RESOURCE_TRADING, false )
call BJDebugMsg(" Resourcetrading is now deactivated" )
endif
endfunction

Now make a trigger like this:

  • RescourseTrading
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • Custom script: call ResourceSharing()
Now you can change it by typing
-resourcetrading on
and
-resourcetrading off

Greetings
SnowTime
 
thanks ill test that out, wouldnt it work the same tho if i just did it in one trigger and just had it like this


  • RescourseTrading
    • Events
      • Player - Player 1 (Red) types a chat message containing -no share as A substring
    • Conditions
    • Actions
      • Custom script: SetMapFlag( MAP_LOCK_RESOURCE_TRADING, true )

and just had that in the trigger with the chat command, wouldnt it work the same?
 
then it will probably work if you type 'call' before it
-->

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -no share as A substring
    • Conditions
    • Actions
      • Custom script: call SetMapFlag( MAP_LOCK_RESOURCE_TRADING, true )
 
Why do we need to have access to 2 different computers? Because I do have access to 2 different computers and if you needed something that required access to 2 different computers, I could do it, I just don't know what that would be that requires access to 2 different computers.
 
well after you test that trigger above ^ you need to press F11 and see if your able to actually give gold back and forth and then use that trigger to turn off gold sharing and then test if you still can give gold or not with F11
in single player F11 doesn't work..
let me know :)
 
I can test it for you when i´m back from holiday in Stockholm. Will be back sunday or monday. But someone else will probably be earlier.
 
Status
Not open for further replies.
Back
Top