[EXSP] Reach & Wandering Lights

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

[EXSP] Reach & Wandering Lights

Post by Diarmuid »

Hi there,

To separate technical discussion (updates, bugs, etc.) from spell creation discussion, I tought that keeping the scripting framework in one place and post new spells separately might be a good idea.

I've just updated EXSP to v1.3.2 (see here: viewtopic.php?f=14&t=4459) and here's two new spells to show off new capabilities.

Reach

This is just a simple spell that triggers buttons or levers from a distance. It's similar in function to pferguso's flying blade, but there's no projectile involved. This showcases how the onHit hook in 1.3.2 detects entities based on class.

VIDEO: http://www.youtube.com/watch?v=EITsiQxMlsU
SpoilerShow
The main functionality code is simply:

Code: Select all

	onHit = function(sId, level, x, y, hitType, subType, entity)
		if subType == "Button" then
			entity:push()
		end
		if subType == "Lever" then
			entity:toggle()
		end
	end
Wandering Lights

This one is more fun. This spell is intended to be used by spawners as a "trap". It creates balls of lightning which will slowly "wander" around in the dungeon, avoid walls and obstacles (they will only hit the party or a monster).

The Wandering Lights will fly straight and turn around corners if in a narrow corridor. If they have an opening either left or right,
they have a 20% chance each of turning in that direction. So in an open space, they have 20% left, 20% right, 60% ahead. If they arrive in front of a wall, they have a 50% chance of turning left or right, if the way is clear of course. If they arrive in a dead end, they'll turn back.

To intelligently spawn these, use the provided function:
exsp_wandering_lights.spawnLight(spawner, room, maxLights, [power])

spawner: the id of the spawner object from which to launch
room: a string identifying a unique space for a set of lights (ex: "treasure_room_1" or "mazeOfShadows"...)
maxLights: the maximum number of wandering lights to spawn in that "room". The spells will remember in which "room" they were spawned,
and when they explode, they will free their spot for another light. So, whether from a pressure plate, timer, or something else, the
call to spawnLight won't degenerate into endless spells.
power: an optional argument if you wish to override the default power of the lights (40).

Notice that Wandering Lights also deflect from blocker objects like monsters, so you can use these also to restrict them to a section of your dungeon.

They are fun in an open room, and very fun in mazes too.

Showcases onPass, onHit, new 1.3.2 getCollisionAhead function, usage of spell extended properties to store variables and spellChangeDirection utility function to spin spells on the fly.

VIDEO: http://youtu.be/HFFEfWZ-rjc

Enjoy!

Sources are available here: https://docs.google.com/folder/d/0B-rVm ... dtNVE/edit
User avatar
Pandafox
Posts: 268
Joined: Wed Apr 11, 2012 11:25 pm
Location: France
Contact:

Re: [EXSP] Reach & Wandering Lights

Post by Pandafox »

Thanks for this excellent work !
I will use it ;)
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: [EXSP] Reach & Wandering Lights

Post by msyblade »

That wandering light is a FANTASTIC idea! Kudos! :P
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: [EXSP] Reach & Wandering Lights

Post by Komag »

both are great additions!
Finished Dungeons - complete mods to play
Post Reply