Scripting spawn help needed -1 reply

Please wait...

Guest

I didn't make it!

0 XP

 
#1 10 years ago

Wondering if Atrocious(or anybody) can help me with a piece of script from one of his earlier posts. 370257-help-garbage_dialogs-script.html My question: It works great for spawning, but with spawn_active set to false, it still continually spawns. Can anyone help? Also, does anyone know how to make it a random spawn, say a 1 in 10 chance that said enemies will be spawned. I've attached my modified bind_stalker.script for your expert assessments. Thanks a ton guys for all your hard work.




Atrocious

Oblivion Lost supplier

50 XP

25th March 2008

0 Uploads

1,448 Posts

0 Threads

#2 10 years ago

It should not continue spawning if you set the first spawn_active to false. Note that you have to reload the game if you have changed something in a script file.

I put a random number generator into it. It selects numbers from 1-10 and will only execute the whole thing if the random number is 10. Of course you can put it into another place. For example you could generate a random number and execute certain spawns if their number is called.

Btw I didn't test the change.




Atrocious

Oblivion Lost supplier

50 XP

25th March 2008

0 Uploads

1,448 Posts

0 Threads

#3 10 years ago
Atrocious;4569171It selects numbers from 1-10 ...

Actually I think it's 0-10. Not sure either way.




Guest

I didn't make it!

0 XP

 
#4 10 years ago

Thanks a ton. Well they keep respawning when the first local spawn_active = true, and the last one spawn_active = false. If the first one is false, nothing happens. I changed the randomizer to 2 for the sake of testing and i believe it works. I'm trying to fulfill my more meat per minute fantasies. Any suggestions? Thanks.




Atrocious

Oblivion Lost supplier

50 XP

25th March 2008

0 Uploads

1,448 Posts

0 Threads

#5 10 years ago

Hm, it also shouldn't continue to spawn when the second spawn_active is set to false. It should only spawn once then.

About the randomizer: math.random(10) == 7 If you change the 10, it will change the number of possible results. If you change the 7, it will just set another trigger. So the odds (1 out of 10) will stay the same.

If you want some kind of random selection, you can use local rnd = math.random(10) if rnd == 0 then ... elseif rnd == 1 then ... elseif rnd == 2 then ... else ... end




Guest

I didn't make it!

0 XP

 
#6 10 years ago

Your help is mucho valued. I still can't get the spawning to stop. I thought maybe the final spawn_active = false needed something else like: set spawn_active = false. Didn't work. Suggestions?




Atrocious

Oblivion Lost supplier

50 XP

25th March 2008

0 Uploads

1,448 Posts

0 Threads

#7 10 years ago

local spawn_active = true if spawn_active and (spawn_timer == nil or spawn_timer <= time_global()) then if spawn_timer ~= nil then if level.name() == "l02_garbage" and math.random(10) == 10 then --this checks if level is The Garbage and executes 1/10 .... end spawn_active = false end spawn_timer = time_global() + 30000 end If you set the highlighted line to false (like it is), it should only execute the spawn once, when you enter the garbage. But when you leave the level and come back, it might spawn again! If you set the first spawn_active to false, it should not spawn at all. But everytime you change something, you have to reload the save.

I can't imagine why that wouldn't work like I explained. It seems pretty clear to me that it should block the spawn after first execution.




Guest

I didn't make it!

0 XP

 
#8 10 years ago

You were my hope obi-one. If you cant figure it out, what hope does that leave for me.

I always re-load a save from the bar before entering the garage to test it. I'm using OL 2.1.1, would this pose a problem. ps. if you want to test it yourself take all the ordinance you can carry and head into the garage. Near where serily is you should find about 20-100 military. This is most fun with an mg or mini gun. Eventually it will crash cause you cant killem fast enough. It really is insane fun. That said it would be nice to clear up the spawn issue.

Cheers.