Spawning mobs with a script

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
The cube
Posts: 94
Joined: Tue Apr 23, 2013 6:09 pm
Location: Barren Desert

Spawning mobs with a script

Post by The cube »

So earlier today when continuing to work on my level, i came across this problem. I was going to have a bossfight where you fight zarchtons that climb from the water, but then realized, that monsters spawned by spawners have no name to call on to add them to the bossfight. So, i need to spawn the monsters with a script. Is it possible?

Oh, and of course the monster spawned with a script would need to be able to have a name.

Thanks.
User avatar
Jgwman
Posts: 144
Joined: Thu Jun 28, 2012 10:14 pm

Re: Spawning mobs with a script

Post by Jgwman »

spawn(object, level, x, y, facing, elevation, [id])
Spawns a new object at given position on a dungeon level where x and y specify the x- and y-coordinates on the map and level is a level index. facing must be a number between 0 and 3 and it indicates the following directions: 0=north, 1=east, 2=south, 3=west. id parameter is optional. If given it must be an unique id in the context of the dungeon. If not given an unique id is automatically generated.

Works with monsters

Ex:
SpoilerShow
spawn("herder", 1, 15, 14, 0, 0, "herder_boss_1")
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: Spawning mobs with a script

Post by NutJob »

I'll eventually add my spawner script weighing in at ~400 lines but it's error prone atm, being I haven't bothered adding in all the error checking. Anyways, I'm sure this reply was extremely unhelpful. ha!
Post Reply