1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

[Closed/Unsolved] Turn off auto pick-up

Discussion in 'Modding Help' started by Vermilicious, Feb 27, 2016.

Tags:
  1. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    Hey guys, "short" question here.

    I'm working on some pipes that transport things such as materials. The problem is that the materials are picked up if a builder is nearby (BuilderAutoPickup.as). Without modifying the auto pickup scripts, is there any way I can temporarily disable this? Looking at the script, I can't really come up with any reasonable way to do it. I can't change a blob's name, there's no tag checks, and I can't set any flag. The only other factor is the shape's vellen, which I don't know exactly what is, and probably isn't a viable option anyway. I have no idea what server_PutInInventory does behind the scenes. Does setting the blob invisible help? Any Z-index threshold? Other options?
     
  2. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    Set a boolean like "inPipe" when a blob enters a pipe (this can be either hard or easy, depends on how you coded the pipes) and in the Take function in BuilderAutoPickup.as, check if the blob you're colliding with has that boolean set to true of false (onCollision/onTick's overlapping sends your blob and the blob you collide with to Take)
    BuilderAutoPikcup.as example:
    Code:
    Line 12: if (blob.get_bool("inPipe")) return;
     
  3. makmoud98

    makmoud98 You are already DEAD Forum Moderator Staff Alumni Tester

    Messages:
    586
     
  4. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    Remove the script from Builder.cfg and then in BuilderLogic.as add the script, and remove it when it's overlapping with a blob that's in a pipe. Mostly the same thing as I said before.
     
  5. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    Maybe I should've been clearer. The problem is not fixing it - the problem is doing it without changing vanilla code or configuration files. Why? Because if I do, I have a potential problem every time the game is patched, and have to mess around with code I did not write myself. It would've been a very easy thing to do, to add a simple tag to blobs that can be picked up, instead of hard-coding the valid types in the auto pick-up scripts, but that's what I have to deal with, and I would prefer not to touch it. I assume I will have to, but I wanted to hear if there was some way around it that isn't so obvious. I don't have the source code, and I can't inspect the objects. All I have is the docs and Objects.txt, which haven't offered a solution yet.
     
  6. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    OK. What about adding a new script to Builder.cfg with what I said previously? eg "BuilderDisableAutoPickup.as" in which you remove the pickup script when you collide with a blob in a pipe and add it when you don't. If the cfgs is what you mean with configuration files, I disagree. I bet money on that the cfg files of classes won't change, and IF it actually happens, you only need to add one line in the cfg.
     
    blackjoker77777 likes this.