• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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..?
 
Level 7
Joined
Feb 26, 2011
Messages
238
Alright i'm on this....

Maybe this is waht you want?
g1.jpg

I can't quite understand....
 
Level 13
Joined
Mar 24, 2010
Messages
950
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?
 
Level 10
Joined
Dec 12, 2010
Messages
569
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:
 
Level 13
Joined
Mar 24, 2010
Messages
950
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
 
Level 12
Joined
Apr 16, 2010
Messages
584
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
 
Level 10
Joined
Dec 12, 2010
Messages
569
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.
 
Level 2
Joined
Mar 3, 2011
Messages
11
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
 
Level 13
Joined
Mar 24, 2010
Messages
950
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?
 
Level 2
Joined
Mar 3, 2011
Messages
11
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 )
 
Level 10
Joined
Dec 12, 2010
Messages
569
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.
 
Level 13
Joined
Mar 24, 2010
Messages
950
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 :)
 
Level 2
Joined
Mar 3, 2011
Messages
11
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.
Top