Lock trading for only one resource?

Ouguiya

New Member
Reaction score
11
Hi everyone!

Well, the title basically says it all.

Is it possible to restrict (or rather, disable) trading with one's allies for one resource (for example: lumber), but leave the other one in tact.

Thanks in advance!

Yours,

Ouguiya
 

Dest

New Member
Reaction score
26
I don't think it's possible but you can disable the allies trading and add a command to give the resources to a player.
 

Ouguiya

New Member
Reaction score
11
I already thought of this possibility, but this is not something I want to do. For the simple reason that it makes things more complicated, less UI-like and more shell-like, which most players neither want nor like.

It doesn't even have to be simple. I would even settle for JASS if need be to squish this.

Yours,

Ouguiya
 

Dest

New Member
Reaction score
26
I already thought of this possibility, but this is not something I want to do. For the simple reason that it makes things more complicated, less UI-like and more shell-like, which most players neither want nor like.

It doesn't even have to be simple. I would even settle for JASS if need be to squish this.

Yours,

Ouguiya

Then do a trigger that if the player gives a resource, you take it away and add a game message that you cannot give the resource. What about that?
 

Ouguiya

New Member
Reaction score
11
Sure, this would be the most reasonable way of doing it. If you can show me the event which fires a trigger when a player trades resources, I'll give you +REP (I haven't seen any such event...)

Thanks!

Yours,

Ouguiya
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
http://www.thehelper.net/forums/showthread.php?t=102077
You can try to use this library. NewGen WE is required, and if you don't know JASS it might be difficult to understand and use. The system that it uses, DataSystem, will also break with the new patch (But that can be fixed easily).

To use the first library I linked to, you could do this:
  1. Open NewGen
  2. Open your map
  3. Paste the code from DataSystem, which I linked to, into a trigger in your map called DataSystem
  4. Paste the code from the first link into a trigger called DRES
  5. Try the code below this list by pasting it into a trigger, then trying to trade wood with someone. If it works, great. If not, let me know and I'll try again. It's untested, since there's only one of me and two people are needed to test a trading trigger
JASS:
scope NoTradingLumber initializer Init

function Actions takes nothing returns nothing
     local integer wood = GetLumberDeal() //The amount of wood traded
     call SetPlayerState(GetLumberDonor(), PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(GetLumberDonor(),PLAYER_STATE_RESOURCE_LUMBER) + wood)
     //Above: Add wood back to the person that gave it away
     call SetPlayerState(GetLumberReceiver(), PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(GetLumberReceiver(),PLAYER_STATE_RESOURCE_LUMBER) - wood)
     //Above:Take the wood away from the receiver
     call DisplayTextToPlayer(GetLumberDonor(),0,0,"You cannot trade lumber")
     //Let them know they can't give people wood
endfunction

function Init takes nothing returns nothing
     local trigger t = CreateTrigger()
     call TriggerRegisterTrade(t,bj_FORCE_ALL_PLAYERS,DRES_LUMBER) //Register the trade
     call TriggerAddAction(t, function Actions)
endfunction
endscope

No guarantees this will work. It's untested, and the first time I've ever tried to use DRES. I've never even seen a map that used DRES, or anything. Oh well, it's worth a shot I guess.
 

Ouguiya

New Member
Reaction score
11
Hi there!

Thanks for your work and your time to write all this down and look it up.

I gave you +rep, and would have loved to tell you "it worked", but unfortunatly, I started the map with WEU.

Sadly, I cannot switch from WEU to Jassnewgen, (I have tried at least 4 times, and twice I asked here in the forum, but nobody was able to give me any advice on how to beat the multitude of bugs which arises from a switch, and doing the map again from scratch is out of the question).

This only leaves basic jass or GUI triggers as the solution.

Still, thanks again.

Yours,

Ouguiya
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
offtopic:
i guess the reason you cannot switch from WEU to newgen is cause you use WEU actions/events/conditions. just look up all of your triggers which use WEU adds, convert the part made with WEU to custom script and add it to your triggers using "call ...." (if you made them with GUI)
i dont know any other problem with switching between WEU and Newgen (im doing it sometimes to translate the editor into english)
 

Ouguiya

New Member
Reaction score
11
Well, my "problem" is simple: I saw that "integrate WEU" option, i'm not THAT dumb.

Problem was however, that even when switched on, loading the map first told me "Trigger action unknown: Initadvancedtriggers", and then, after pressing OK, it simply crashed the editor.

So yeah, THIS is my problem.

Removing all the trigger actions is something I tried, but then the JassNewgen syntax checker finds a lot of syntax errors which shouldn't be there (something about multiple referencing).

Still, thanks for the help, I will try one last time to switch (like I said, I tried it often, and it's starting to become really bothering...), with Accname instructions, since I didn't try converting them to custom text before.

Thanks again.

Yours,

Ouguiya
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Maybe you had already it, but in order to integrate weu, you have to open newgen we.exe with an empty map or at least without any weu feature, integrate weu, close newgen, and reopen it.
 

Ouguiya

New Member
Reaction score
11
Heya!

Thanks for the reply.

I tried to do what you said (I admit I haden't tried it that way before), but it doesn't work.

It still tells me that the functions are unknown, and then crashes.

It would be really cool if this feature worked. I hope you can provide a bit further guidance.

Thanks again.

Yours,

Ouguiya
 

HydraRancher

Truth begins in lies
Reaction score
197
This probably wont work, but with Newgen, before opening WEU map, thingy, do UMSWE > enable UMSWE and Grimoire > Enable no limits, close Newgen, and re-open, then try load ur WEU map.
 

Ouguiya

New Member
Reaction score
11
Tried it, didn't work, sadly.

The only thing which seems to work so far, is to convert the triggers which are problematic to custom text, which will then not crash the editor since it's JASS and not GUI functions.

Thanks in either case, I will try to move forward from there.

Yours,

Ouguiya
 

Ouguiya

New Member
Reaction score
11
Correction:

By some sheer miracle, I managed to open the map, converting all WEU functions to custom scripts.

Troll-brain: i had a look at your system. It looks great, but unfortunatly, I am a complete noob at JASS, so I wouldn't even know how to use it.

Could you maybe give any sort of guidance on it?

Thanks again.

Yours,

Ouguiya
 

Dest

New Member
Reaction score
26
You can just do what I said... It's easy, quick and you just don't even need the allies menu.
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
Ouguiya said:
Troll-brain: i had a look at your system. It looks great, but unfortunatly, I am a complete noob at JASS, so I wouldn't even know how to use it.

Troll-brain's system is the one I used in my post. The functions that I used haven't changed names, so you should be able to follow these instructions:
  1. Copy the system Table and paste it into your map. You'll probably want Version 2.0, 3.0 is only used for patch 1.23b and 1.24.
  2. Copy Troll-brain's system into your map
  3. Copy the trigger from my previous post into your map
  4. Test

>You can just do what I said... It's easy, quick and you just don't even need the allies menu.

It's also annoying to have to type commands to trade, rather then simply using the allies menu.
If you refer to your other solution of "Then do a trigger that if the player gives a resource, you take it away and add a game message that you cannot give the resource", well... That's exactly what the trigger talked about in my post should do. There is no default "Player - Player trades Resource" event, so we need to use Troll-brain's system which creates one.
 

Ouguiya

New Member
Reaction score
11
Hi there, trb92!

Thanks for the reply!

Well, I tried to do just that (oh yeah, btw: Shouldn't I use the newest version then? after all I want to play my map on Bnet :D)

Unfortunatly, like I said, I am a complete, total, utter noob when it comes to JASS, so I don't even know if I can simply copy past the thing and overwrite anything which was in the trigger, or if I have to leave the stuff which was written in the trigger intact, etc.

However, I once tried it, but the syntax checker bombarded me with Syntax-errors...

Could you maybe give a "step-by-step guide for complete dummies" on this one?

(Note: What I have done up till now, is to leave the trigger custom text intact, and simply paste the function in-between the "function - end function" line (the first and second lines of the trigger).

But, I'm guessing I'm doing things really wrong...

Thanks again.

Yours,

Ouguiya
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
  1. Create a trigger
  2. Change the triggers name to the name of the system you are importing (Optional, but helps with readability later.)
  3. Use "Convert to Custom Text"
  4. Delete everything you get
  5. Paste in the system

>Shouldn't I use the newest version then? after all I want to play my map on Bnet
The newest patch is only available on Westfall, the gateway made for testing beta patches. Table 3.0 is made with new native functions that exist in that patch but not the current stable patch, but the four normal BNet gateways don't have the newest patch. They still have patch 1.23. Table 3.0 will only work on Westfall. You'll need to update to Table 3.0 once the new patch comes out on all four gateways, but right now only Table 2.0 will work on them.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top