Author Topic: mob_wave script  (Read 1748 times)

mob_wave script
« on: September 04, 2016, 02:58:20 pm »
Hello, I would like to know how to use this. Do I need to manually trigger the wave through a command? or do I have to set the script and function in the mob wave entity through mapper?

JovankaB

  • Guest
Re: mob_wave script
« Reply #1 on: September 04, 2016, 08:57:44 pm »
You can add Mob Wave Spots and manually trigger the mob wave using admin ~run commands (information about this I pasted below), but of course you can also do it with Mapper and scripts. Beside GM abuse it's used for predators (by calling TryStartEncounterMobWave() when a player enters encounter). You don't have to set anything in the Mob Wave Spot entities, but you need at least one Mob Wave Spot in the map for the mob wave to work. And you need a player in the map. Then call StartMobWave(Location@ loc, uint type, uint level, uint timeScale) function from scripts, or with admin account use ~run commands to start and control it.

The type of mob waves (enemy types, timing etc) is stored in mob_wave_data.fos in a multidimensional array.

Remember you need at least one real player (not on active admin account) in the map for the mob wave to spawn enemies. (if it didn't work for you then it's most likely the reason :D) That's because normally you wouldn't want invisible GMs to start mob waves randomly in the game whenever they enter an encounter. You can change it by defining __DEBUG__, then admins will count as real players.

This is information copied from an old GM thread:

Mob Wave is a cyclic mob spawner. If Mob Wave is started in a location, mobs spawn at Mob Wave Spots as long as some players are in the map and there are some Mob Wave Spots in the map. All encounters have the Mob Wave Spots (they are invisible by default) and Mob Wave is started when a first player enters it.

Mob Wave Spot is just an item that serves as "spawning place".

~run mob_wave start [TYPE] [LEVEL] [SCALE]
Starts a Mob Wave in the location.
TYPE: 0 - custom (nothing for now), 1 - encounter mob wave (predators), 2 - ghouls (for testing / zombie events)
LEVEL: keep 0 to start Mob Wave from weakest creature, every type has different number of levels
SCALE: time scale / speed of spawning, 0 or 100: 100% (1:1), any other number is %, for example 20 is 20% (mobs will spawn 5 time faster), 200 is 200% (mobs will spawn 2 times slower)

~run mob_wave erase 0 0 0
Stops and removes Mob Wave from the location (but not the spots) and all mobs spawned by the Mob Wave.

~run mob_wave info 0 0 0
Information about Mob Wave currently running in the location.

~run mob_wave spots_show 0 0 0
Shows all Mob Wave Spots on the map.

~run mob_wave spots_hide 0 0 0
Hides all Mob Wave Spots on the map.

~run mob_wave spots_add 0 0 0
Adds a mob Mob Wave Spot where you stand (invisible by default).

~run mob_wave spots_delete 0 0 0
Removes ALL Mob Wave Spots on the map.


I'm sorry if the information is a bit chaotic but it's actually simpler than it looks
« Last Edit: September 04, 2016, 09:38:47 pm by JovankaB »

Re: mob_wave script
« Reply #2 on: September 05, 2016, 03:27:11 am »
Absolutely not chaotic! I managed to understand the params before posting this, and in fact, i think i made it work, but i was logged as admin and nothing happened, and i just thoght it was something wrong i did.

Thanks a lot! gonna test it right away tomorrow once I get home. I feel im the only one who liked this feature xD