Author Topic: Bot spawning mod (modify request?)  (Read 3390 times)

Alright so this mod here makes it so that no bot spawns unless you get near it. I was wondering if there was a way to make it so that certain bots always spawn regardless if someone is near or not? So like select bots will bypass the bot spawning and spawn even if no one is near while the other bots still stay unspawned until someone comes near them

Use Zone's, you can event the Zone so that when you go through it it'll enable the bots.

Use Zone's, you can event the Zone so that when you go through it it'll enable the bots.

See the problem with that is that if I make it so that onplayerenterzone > bots > spawn(not the exact events but you get me), everytime another player enters the zone they'll spawn again, and if a player leaves the zone when someone is still in it, the bots will still despawn. Theres prob a work around with oninzone, and a bunch of toggleeventenable and relayevents, but i feel that that is too much and if there was a simpler way it could be done using this mod

onEnterZone, if the variable is 0 spawn, increment variable. On leave zone, decrement variable, if it's 0 then despawn.
might even work with print counts if you don't have more than nine players, leave it at 9 for 0 and count up from there, when you overflow twice without an underflow, make it disable its normal underflow despawn and relay to another print brick and make it count up one. It should only toggle the events once. If it underflows, have it fire a relay back and increment itself back to 0, when your main brick gets a relay make it reset everything and despawn the bots. If your secondary brick overflows, you will ascend to godhood because you have 100 players on your server it must be new years or something.
I spent way too much time working out the logic of print counts for you there. Use VCE because I probably goofed, but even if I didn't it's just simpler to use in general and it's useful

To remove all this hassle it's better to just create an event where it has something like Bot > AttemptSpawn and Bot > AttemptDespawn (if I have time tomorrow I'll give a link here)
Basically if the bot is already spawned it will not respawn it, but if it does not exist the bot will spawn.

See the problem with that is that if I make it so that onplayerenterzone > bots > spawn(not the exact events but you get me), everytime another player enters the zone they'll spawn again, and if a player leaves the zone when someone is still in it, the bots will still despawn. Theres prob a work around with oninzone, and a bunch of toggleeventenable and relayevents, but i feel that that is too much and if there was a simpler way it could be done using this mod

What I do to fix that is, on the bot hole its self just put onbotspawn > self > setbottype none (you need to add a delay though otherwise the bots wont go away, so add like a 2 second delay which is 2000).

Then when a player enters the zone the events I do is onplayerenterzone > namebrick(the bot hole) > seteventenabled "0" then afterwords you put in the event to spawn the bot with a delay usually I do 400 onplayerenterzone >namebrick > setbottype default.  

Then you wanna have the zone disable its events so can't be activated again. For example
onplayerenterzone > self > seteventenabled 0 1 2 3 4
Usually I name the zones so I can add more then one so no matter what the bots are enabled and you can't bypass the zone.

If you want them to go away after they're killed just do onbotdeath > self > setbottype none

This is how I do my events when it comes to enabling bots, so it should work with you.
« Last Edit: May 17, 2017, 09:54:51 AM by petey the pyro3134 »

Snip

Okay well this seems good, but before trying that, I'll just wait for Kyuande so that I can try and keep it as simple as possible

do note that this just enables bots once when players trigger it, it never removes the bots (which may be the desired effect)

Done. Adds 3 events:
 - Bot > Despawn [doEffect] --- The bot will disappear
 - Brick > AttemptSpawn --- The bot will attempt to spawn but if the bot is already spawned it will not respawn
 - Brick > AttemptDespawn [doEffect] --- The bot will attempt to despawn if it exists, could be better to just register the unspawnhole function but this gives you an option to create the despawn effect it normally does

Example of making a bot do a 'disappear' trick and then respawning back to normal


Event_BotSpawning

Alright so I tried many ways to do what I wanted to get done, but it arose way to many problems. The amount of events and zones I have to add is way too much, and it makes me lag as well. So back to the original request, is there no way to make it so that certain bots are immune to the bot spawning script so that they stay spawned regardless of if anyone is near by or not.

EDIT: Also I just really need this for my server so im willing to pay someone to make it for me if that's what it takes

would take a look at it, except dropbox doesn't want to give me the file (their traffic limit was reached)

use something like leopard hosting, dropbox is randomly locking people out for stupid reasons

PM me and I'll make it.

Kyuande, can those events be used so you can make a bot spawn only once?

Yes, that's what they do. It returns the function if it already exists.