Author Topic: Code re-writes itself?  (Read 1314 times)

      So I got sick of armed bots being handicapped and ramming their opponents even if their opponent is a zombie, so I went into the bot_base file for Bot_Blockhead and changed the hTooCloseRange from 7 to like....thirty. Didn't do anything. So I went back to change it to a lower value (just in case it was too high or some stuff) and noticed that it wasn't still thirty. It was back to seven. I did this several times, lowering the value, and still got the same problem. The same problem that won't let me modify the push-broom's impactimpulse, or the gun's.  The code just resets itself!
       
       I was trying to make a Mario-Kart DD map with bots and nearly did, but the code that makes them jump out of vehicles when they approach enemies completely ruined it. Hard. I'd have a neutral bot driving to a set brick and another bot shooting rockets from the back seat, BOTH with their wander distance set to zero, but if an enemy got too close to the hostile bot, the bot would abandon ship and pretty much wreck my hopes and dreams. This is because of a code in the Bot_Hole/hole.cs file that literally makes them exit vehicles if an enemy is too close. Why that code is there, I do not know, but when I deleted that particular code and started Blockland back up, the bots STILL kept jumping out of their vehicles. I went back to the cs file and got pretty mad. The code I'd deleted was right back where it was, like some geeky horror story.

       Also, I notice during minigames that bots override their set wander distance. If I want a bot to go to a brick and stay behind it like cover, I set it's wander distance to zero so it won't move once it gets there. But once it spots an enemy during a minigame, it's set wander distance is ignored completely. Because of this and the ramming thing, all of my pain-stakingly crafted Bot TDM's turn into awkward, clashing, catastrophes. It's starting to bother me. I mean, in the Bot_Hole's/hole.cs file, there's a code that is actually made to prevent bots from ramming each other if they're armed. It doesn't work for me. I just wanna  know why man.

       As usual, I'm no programming wizard, so try to be nice and use normal-people jargon. Everyone likes a nice guy! :) Even people that hate you!

To prevent the code being overwritten, you can mark the zip file as "read only". However, I would recommend instead making a separate add-on that modifies the values without modifying the files.

For your problem with bots staying still, there should be a "stand ground" event or something like that - I can't remember the name.

Thanks again dude. I'll give it another shot but I may have actually done that before. Y'know, creating a separate file. I actually successfully created a Bot_Better, but it still rams folks. I'm thinking of that Bot_Default add-on. It literally does nothing. Not even in minigames. It won't attack, even if evented to do so. It'd be perfect if it could still aim and shoot without moving. I'll mess with it! :)
    As for the stand ground thing, I don't believe it exists. I wish it did, but the closest thing I could get to it was setwanderdistance, and setbotpowered. I even downloaded the no-move playertype, but two problems occur when I use it on the bots. A) They go ballistic, ducking like crazy to escape the invisible walls that hold them, effectively making combat irritating or forgotten in their minds. B) Any weapons with an impact impulse will cause the bots to move in a direction relative to the attack. Slowly, literally like a snail.
    It's like trying to organize an army of ADHD robots. They absolutely WILL not remain still, even if confined by external forces. : l

You must be doing the events wrong. I use the default bot for about everything, then use events to make it do what I want. I assume you are using Slayer Bots? I could't help you with that. Probably why they move after spotting an enemy, even after setting wander distance to 0? Not sure.

Nope, not slayer bots. Just your standard hole bots. The slayer bots won't appear (even if the preferred player value is greater than zero) for me on my new computer for some reason, but that's another problem I'm trying to fix without bugging folks. How do you get a default bot to attack you though? I'm assuming you're talking about the add-on, not the blockhead bot that comes with the game automatically. I want it to just stand there and aim and shoot, leaving its movements to my code. That's it. That would be awesome. SO awesome.

The slayer bots won't appear (even if the preferred player value is greater than zero) for me on my new computer for some reason, but that's another problem I'm trying to fix without bugging folks.
Those broke after the latest BL update. I need to update Slayer to fix them.

Okidoki! Whatever wait is well worth it.

Just to let you know in case you have this problem again: most(if not all) files that are included by default in Blockland will automatically be updated when you launch the game. This is what caused your problem.