Few questions

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
thermalburn
Posts: 13
Joined: Mon Dec 24, 2012 12:16 am

Few questions

Post by thermalburn »

A couple of quick questions:

1. is there a way to make pits(with or without trap doors) just kill the whole party rather then drop them down 1 level?

2. I made a clone of a shield and gave it a stat of Protection +2 and Evasion +2. However in game, the Protection stat does not apply to the player; the shield clearly says +2 Protection but it just doesnt apply for some reason. The Evasion stat works fine

3. I'm practicing with my scripting and im getting an error "Bad Argument to findEntity (string expected, got nil)". Here is what im doing:

There are 2 pressure plates. the first one checks to see if an entity exists; if it does then destroy it otherwise do nothing. the second spawns the entity. the player will step on the first plate (since the entity isnt spawned, then it should do nothing) then he will step on the second plate (which spawns the entity) finally he will go back to the first which this time will find the entity and destroy it.

I spawn the entity fine, but the destroy part seems to fail. here is my code:

spawn entity:

Code: Select all

function spawnMonster()
	spawn("goromorg", 3, 23, 18, 3, skellington)
end
destroy entity:

Code: Select all

function toospookyforme()
	local spawnedEntity = findEntity(skellington)
	if spawnedEntity == nil then
		print("nil")
	else
		print("destroy")
		skellington:destroy()
	end
end	
there error generates on line "local spawnedEntity = findEntity(skellington)"

thanks. i will probably update this with more questions as i work further :/
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: Few questions

Post by Xanathar »

1 =>
Put an hidden pressure plate over the pit, and connect it to this:

Code: Select all

function gameover()
	damageTile(party.level, party.x, party.y, party.facing, 64, "physical", 100000000)
end
If you prefer to see the animation, connect it to a very short timer (like 0.5 sec or less, try what's best) and connect the timer itself to the above function.

2 => Don't know :D

3 =>
function spawnMonster()
spawn("goromorg", 3, 23, 18, 3, "skellington")
end

and

local spawnedEntity = findEntity("skellington")

Note that if you know the id this way, you should be able to use it directly as:

Code: Select all

function toospookyforme()
   if skellington== nil then
      print("nil")
   else
      print("destroy")
      skellington:destroy()
   end
end   
Disclaimer: all of this should in theory work, but I tested none.
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
thermalburn
Posts: 13
Joined: Mon Dec 24, 2012 12:16 am

Re: Few questions

Post by thermalburn »

great! they both worked, thanks a lot!

anyone have a solution to #2?
thermalburn
Posts: 13
Joined: Mon Dec 24, 2012 12:16 am

Re: Few questions

Post by thermalburn »

Im having some difficulty in understanding the FX setlight command.

how do i define a new FX entity?
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Few questions

Post by Komag »

IIRC 2 can't be solved at present, deals with "hard coded" stuff

you can lay down fx objects in the editor and mess with it via scripts later, or spawn them on the fly entirely with scripting. If it will be for lighting that is longer term than momentary, best to use custom defined light objects instead, as they persist across saves while fx lights/effects don't.
Finished Dungeons - complete mods to play
thermalburn
Posts: 13
Joined: Mon Dec 24, 2012 12:16 am

Re: Few questions

Post by thermalburn »

ah thats too bad.

what exactly is an FX entity? i dont see it anywhere in the props/items/logic screen
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Few questions

Post by Neikun »

Guys guys, is that a possible work around for not being able to add protection to a shield class item?


Perhaps in the party definition, a check if the item is equipped, and it runs a function that modifies the stat if it returns true?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Few questions

Post by Komag »

thermalburn wrote:ah thats too bad.

what exactly is an FX entity? i dont see it anywhere in the props/items/logic screen
can't test right now, but maybe it's only visible in the all list
Finished Dungeons - complete mods to play
thermalburn
Posts: 13
Joined: Mon Dec 24, 2012 12:16 am

Re: Few questions

Post by thermalburn »

yes it is. thanks

also how do you get scripts to initialize as soon as the game is loaded? Say i have a function, how can i get it to automatically start doing its task without me having to trigger it?
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Few questions

Post by Isaac »

thermalburn wrote:yes it is. thanks

also how do you get scripts to initialize as soon as the game is loaded? Say i have a function, how can i get it to automatically start doing its task without me having to trigger it?
Don't put it in a function; or call the function from outside.
Post Reply