Hi! im new to this forum
I've finished Legend of Grimrock twice a year ago, but became interested in the editor just a week ago
So... i do have a doubt!!
I've did some alcove item checking thanks to another thread you have here, like "you put a blue gem here, and the door opens, tadaa!!", but my doubt is: how to check if a specific object is at some specific coordinates?
Let's say i want some item at a tile, on the ground, to trigger a teleport [n]after[/n] some torches are correctly put in their holders
Please help me with this!! see ya!
Hello!! How to check an item position ?
Re: Hello!! How to check an item position ?
you'd want something like this - replace the xxx with the length of your item's name
edit: it's Saturday and I've had a couple sorry
Code: Select all
function killpillar1()
for i in entitiesAt(self.level,x_position,y_position) do
if i.name:sub(0,xxx)== "your_item_here" then
--do_stuff_here
end
end
end
edit: it's Saturday and I've had a couple sorry
Re: Hello!! How to check an item position ?
you don't need to use the sub code unless you plan to search for only part of the name. If you're going to search for the full name, just do
if i.name == "your_item_here" then
sub can be very useful at times, but probably not here
In this case, using the name will work if you don't need it to be a very specific item, such as a particular rock, but any rock will work. This is probably the best approach.
if i.name == "your_item_here" then
sub can be very useful at times, but probably not here
In this case, using the name will work if you don't need it to be a very specific item, such as a particular rock, but any rock will work. This is probably the best approach.
Finished Dungeons - complete mods to play
Re: Hello!! How to check an item position ?
OOOkey! i've decided to use a counter in combination with a script
So, the counter is set at 5, linked to the 4 torches which need to be activated. And then there's the item-thingy.
This is what i've written and doesn't work :
function plataformacounter()
for i in entitiesAt(2, 8, 10) do
if i.name == "daggerdragon" then
counter_dragon:decrement()
print (counter_dragon:getValue())
break
end
end
end
When i put the said dagger on the floor on that tile, the teleport does not spawn! neither the print message appears. I've tried to use before a simple conector with a hidden plate and the teleported worked... but that's it! i want a specific item to trigger it.
What's happening??
So, the counter is set at 5, linked to the 4 torches which need to be activated. And then there's the item-thingy.
This is what i've written and doesn't work :
function plataformacounter()
for i in entitiesAt(2, 8, 10) do
if i.name == "daggerdragon" then
counter_dragon:decrement()
print (counter_dragon:getValue())
break
end
end
end
When i put the said dagger on the floor on that tile, the teleport does not spawn! neither the print message appears. I've tried to use before a simple conector with a hidden plate and the teleported worked... but that's it! i want a specific item to trigger it.
What's happening??
Re: Hello!! How to check an item position ?
your code seems to work. What you'll need, however, is a trigger for the script. You could either set a timer to run the script every now and then or put in a hidden pressure plate
Re: Hello!! How to check an item position ?
Oh!!! now it works thanks for the help guys ^^
EDIT!! more doubts :S
For this SPECIAL item, i want a rock with the appearance of the Zhandul orb (meaning, i don't want any stat in it).
Im trying to use the cloneObject{ in my dungeon assets, but i use the rock as baseObject and to change the model to the zhandul i've written "model = "zhandul_orb.fbx"", but it doesn't work. How can i make it right?
EDIT!! more doubts :S
For this SPECIAL item, i want a rock with the appearance of the Zhandul orb (meaning, i don't want any stat in it).
Im trying to use the cloneObject{ in my dungeon assets, but i use the rock as baseObject and to change the model to the zhandul i've written "model = "zhandul_orb.fbx"", but it doesn't work. How can i make it right?
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: Hello!! How to check an item position ?
It needs to be the full path to the item, not just the model name. So something like this;
If you don't want the user to be able to throw it as a weapon, fire it from a sling or to stack it with other objects of the same type, you will need to change some other of the default properties of the basic rock, such as;
throwingWeapon = false
stackable = false
ammoType = nil
Or you can define a whole new object if you want to make something that doesn't share any properties of a rock.
Code: Select all
cloneObject{
name = "rock_orb",
baseObject = "rock",
uiName = "Defunct Zhandul's Orb",
model = "assets/models/items/zhandul_orb.fbx",
gfxIndex = 157,
}
throwingWeapon = false
stackable = false
ammoType = nil
Or you can define a whole new object if you want to make something that doesn't share any properties of a rock.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.