Teleporting an object (prop)

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

Teleporting an object (prop)

Post by thermalburn »

I'm trying to figure out if its possible to teleport/move/delete/spawn a prop object. I want to move a statue to a different part of the room. I searched not only the forums but online as well and didnt find a sufficient answer

thanks
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Teleporting an object (prop)

Post by msyblade »

You can use a script to destroy the original and spawn another. think it would look like this: (ish)

Code: Select all

function movestatue()
temple_goromorg_statue_7: destroy
spawn("temple_goromorg_statue", 1, 21, 10, 2)
end
the 4 numbers are: Level, x, y, facing. The xy are in the bottom right of the editor when u mouse over a square. the facing is 0=North, 1=east, 2=south, 3=west.I THINK the statues face reverse (mess with it and you''l get it) ;)
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
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Teleporting an object (prop)

Post by Grimwold »

Just a minor correction to msyblade's code as destroy needs brackets:

Code: Select all

function movestatue()
  temple_goromorg_statue_7:destroy()
  spawn("temple_goromorg_statue", 1, 21, 10, 2)
end


msyblade wrote:You can use a script to destroy the original and spawn another. think it would look like this: (ish)

Code: Select all

function movestatue()
temple_goromorg_statue_7: destroy
spawn("temple_goromorg_statue", 1, 21, 10, 2)
end
the 4 numbers are: Level, x, y, facing. The xy are in the bottom right of the editor when u mouse over a square. the facing is 0=North, 1=east, 2=south, 3=west.I THINK the statues face reverse (mess with it and you''l get it) ;)
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: Teleporting an object (prop)

Post by Diarmuid »

And if I can add my 2cents here's grimwold's code modified for a general usage function: ;)

Code: Select all

function moveObject(object, level, x, y, facing)
  if object == nil then return false
  local name = object.name
  local id = object.id
  object:destroy()
  spawn(name, level, x, y, facing, id)
end

moveObject(temple_goromorg_statue_7, 1, 21, 10, 2)
EDIT: Modified so that it keeps the same id.
Last edited by Diarmuid on Mon Dec 24, 2012 4:05 pm, edited 1 time in total.
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Teleporting an object (prop)

Post by msyblade »

you guys rock :oops:
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
Ixnatifual

Re: Teleporting an object (prop)

Post by Ixnatifual »

Here's a modified version of diarmuid's general-purpose function for the hardcore. It now contains flaws that need to be fixed for it to work properly.

Code: Select all

funtcion moveObject(object, level, x, y, z, facing)
  if object == "" then return false
  string name = object.name
  int id = object.id
  object:destroy()
  spawn(name, level, x, y, z, facing, id)
end
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: Teleporting an object (prop)

Post by Diarmuid »

I really laughed out loud. :lol: :D
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Teleporting an object (prop)

Post by Komag »

that's like the biggest nerd joke ever (hint - I found it quite funny :ugeek: :mrgreen: )
Finished Dungeons - complete mods to play
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: Teleporting an object (prop)

Post by Xanathar »

:lol: :lol: :lol: :lol:
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: Teleporting an object (prop)

Post by thermalburn »

Lol thanks guys...i guess....

:D

Also, to somewhat change the topic since i really dont think its necessary to start a new thread:

Is there a way i can few all the stats and stuff for the monsters? I'm trying to modify the mobs but i cant really do that unless i know what their initial base stats are. Online didnt have much; is there somewhere in the game files i can go look?
Post Reply