Page 2 of 2

Re: Spikes that stay out

Posted: Thu Aug 20, 2015 11:41 pm
by Isaac
kelly1111 wrote:How do you move the script entity (teleportDest) ingame (via for example a floor trigger) .. what script would do that?
This run from anywhere, would move the script_entity to 14,14 on level 1:

Code: Select all

teleportDest:setPosition(14,14,1,0,1)
And that would become the new destination of the horn.

Here is a neat trick to do with this horn. Place this function in the teleportDest script_entity, and connect several pressure plates to it; [hidden or otherwise]. Set them all to 'onDeactivate'.

The function moves the script to the location of the calling pressure plate, and so the plates act like milestone markers. The last plate the party stepped on, is where the horn will take them.

Code: Select all

last_call = nil

function waypoint(caller)
		if  caller.go.id ~= last_call or last_call == nil then
			last_call = caller.go.id
			local recall = {}
            recall[1], recall[2],recall[3],recall[5] = caller.go:getPosition()
            recall[4] = caller.go.elevation
            teleportDest:setPosition(unpack(recall))
		end
end
*Now THIS is indeed something that could allow the crafty player to bypass an obstacle in the dungeon, so the plates should not be enabled for anything but the party.

Re: Spikes that stay out

Posted: Fri Aug 21, 2015 1:43 am
by Emera Nova
I've tried adding diggable = true, to the title for dungeon_floor_01 and when I replace it in game and then run it it still pops up saying can't dig here.
THOM wrote:How did you manged it having the spikes staying out?

To get tilesets diggable you have to add in the tile-definition the line

diggable = "true",

(not sure at the moment if with or without quotationmarks).

Re: Spikes that stay out

Posted: Fri Aug 21, 2015 2:03 am
by Emera Nova
So I'm using this

Code: Select all

defineObject{
   name = "horn_of_recall",
   baseObject = "base_item",
   components = {
      {
         class = "Model",
         model = "assets/models/items/horn.fbx",
      },
      {
         class = "Item",
         uiName = "Horn of Recall",
         gfxIndex = 297,
         weight = 1.0,
         primaryAction = "blow",
         description = "This horn has a burnt electrical smell.",
      },
      {
         class = "ItemAction",
         name = "blow",
         uiName = "Blow Horn",
         cooldown = 4,
         onAttack = function(self)
            hudPrint("The party is teleported.")
             local recall = {}
             recall[1], recall[2],recall[3],recall[5] = teleportDest:getPosition()
             recall[4] = teleportDest.elevation
            party:setPosition(unpack(recall))
            playSound("blow_horn")
         end,
      },
   },
}
and instead of using a script entity as the item I'm having the party throw out a loadstone, which is in turn named teleportDest. It works fine as long as the party doesn't try to teleport with the loadstone in their invent or on their person. How can I get it so that it will check to see if the item is out of the invent, and if it isn't show a message telling the player they can't teleport with it in their team.

Also anyone have anything on the Warg following fish idea?

Re: Spikes that stay out

Posted: Fri Aug 21, 2015 3:14 am
by Emera Nova
I solved the digging inside a dungeon problem, you have to also include in a heightmap for what ever reason.

The bolded parts are the two things that I think are needed for it to run correctly. You also need to through in a forest heightmap object in the game for it to show stuff correctly.

Code: Select all

defineTile{
	name = "dungeon_floor_tiles_dig",
	editorIcon = 192,
	color = {110,110,110,255},
	builder = "dungeon",
	diggable = true,
	randomFloorFacing = true,
	heightmapMaterial = "dungeon_floor_01",
	ceiling = {
		"dungeon_ceiling", 1,
	},
	wall = {
		"dungeon_wall_01", 35,
		"dungeon_wall_02", 35,
		"dungeon_wall_drain", 2,
	},
	pillar = {
		"dungeon_pillar", 1,
	},
	ceilingEdgeVariations = true,
	ceilingShaft = "dungeon_ceiling_shaft",
	randomFloorFacing = true,
}

Re: Spikes that stay out

Posted: Fri Aug 21, 2015 8:31 am
by Isaac
Emera Nova wrote:So I'm using this ... and instead of using a script entity as the item I'm having the party throw out a loadstone, which is in turn named teleportDest. It works fine as long as the party doesn't try to teleport with the loadstone in their invent or on their person.
That is potentially a gnarly can of worms, and not recommended; and as THOM mentioned above, also allows for potential exploitation... But even worse [unknown], is ~what happens if they use the horn while the destination stone is in the air; or if it hits a monster; or lands somewhere unintended that cannot be exited if the horn is used. There might be issues with teleporting onto pressure plates (or other teleporters) ~if that's where the stone lands... This is why I mention to set the plates in the example above to be "onDeactivate"; so that the party exits the tile before the plate activates.

*Projectiles tossed into the void can sometimes fly off the map. There are a lot of troubling *if's* with this approach; is it really imperative that the party be able to arbitrarily throw a teleport destination to any spot on your map? Whatever it is that you are intending, there is probably a better way to make it work than by making the destination a tossed item.

**The reasoning for using a script_entity as the destination was... ease of visibility in the editor, that it had no model or textures, and the fact that it wasn't an interactive item that could be affected by in-game events.

Re: Spikes that stay out

Posted: Fri Aug 21, 2015 1:21 pm
by Emera Nova
The reason for it being the way I had it explained was I'm currently working on a Runescape themed Dungeon where I am trying to simulate as many of the propriety of dungeoneering. Inside of dungeoneering you have a spell called create loadstone, this loadstone can then be placed anywhere in the dungeon and recalled back to it. (mainly used as a form of teleporting across the dungeon as a time saver).
While this form of teleporting is unsuggested for grimrock due to so many of the possible issues its needed to similate what Runescape has. The throwing of the object isn't something you can do in runescape which is an unfortunate part of grimrock being able to throw the item.

Now prehaps we can brainstorm on a different way other than using an item itself.
I was thinking maybe making a spell that will check to see if a loadstone as been created already if not then spawn on in on the players location. If there is a loadstone present then teleport to it and destroy it. (this is pretty much how it works, only differnet would be being able to choose to override a loadstone location.)

Now if it is run this way it would have to somehow be an object that doesn't get in the players way when walking but can't be picked up. Prehaps a custom boulder that instead of an item is a object like the pots or barrels?

Re: Spikes that stay out

Posted: Fri Aug 21, 2015 2:52 pm
by THOM
Okay - I don't know the mechanic of Runescape - but wouldn't it be a possibility to create an object instead of an item? An object would be linked to the ground and could not be moved or thrown...

Re: Spikes that stay out

Posted: Fri Aug 21, 2015 3:21 pm
by Isaac
I would think that a spell could be made that placed a non-interactive object on the tile, and set that tile as the current destination.

Re: Spikes that stay out

Posted: Fri Aug 21, 2015 4:31 pm
by Emera Nova
I'm thinking two spells possibly, one that checks to see if a loadstone exists if it does destroy that loadstone and create a new one at current location. If it doesn't exist create a loadstone at the current location.

And then the second spell would just allow the party to teleport to the loadstone and destroy it upon teleporting.

Anyone able to put something like that together?

Re: Spikes that stay out

Posted: Fri Aug 21, 2015 10:16 pm
by AndakRainor
May be I'm a little late in this thread about spikes, but why do you want to use an item to set a teleport destination ? The spell pack as already plenty of ways to teleport the party 8-)