Ask a simple question, get a simple answer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

There doesn't seem to be anything wrong with that then. The party and the wall object are both facing East, and both on the same tile.

It is easy to reverse the model facing (in Blender), and have a wall object look correct when really on a different tile than it seems.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat »

I think I have used a flat wall model for this, and resized it in gmt, don't remember why.
I never saw this "issue" when I tested the object. :roll:

Well, I have try to add self.go.projectilecollider:enable() and disable() into the object's controller definition but that doesn't seems to work, then I have desactivated the projectile collider directly in the editor.
This works, except you cannot throw an item on the mouse pointer when you are one square back, in front of the wall. But a throwing weapon can be thrown when placed on the hands. But this doesnt bother.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Upload the model, and I'll look at it.
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

bongobeat wrote:This works, except you cannot throw an item on the mouse pointer when you are one square back, in front of the wall. But a throwing weapon can be thrown when placed on the hands. But this doesnt bother.
This happens because it's marked as a secret door. If you remove secretDoor = true from the definition, you'll be able to throw items through it using the mouse.

(The only other effect of secretDoor is that it changes how the door is displayed on the automap.)
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
kelly1111
Posts: 349
Joined: Sun Jan 20, 2013 6:28 pm

Re: Ask a simple question, get a simple answer

Post by kelly1111 »

Question: I want to set up the following. I want a (an event, level up in this case) to activate a teleporter. This teleporter is set to teleport an object (a chest with contents for instance from a room nearby) to where the party is. how do I tell the teleporter it should teleport its stuff to where the party is? Or Am I making this overly difficult and is there an easier way?
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

The problem is: what do you mean by "telepeort to where the party is"? If you teleport stuff on the tile in front of the party (which would be possible with some tweaks) what happens, if this tile is a wall? Or a pit?

Of course you could teleport the stuff on the tile the party is on, but that could mean, that the player oversees it.

Thats why stuff, that comes as a revard for something, usually appears on a certain spot (an alvove, an altar...) or in the inventory/mouspointer of the party...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Zo Kath Ra
Posts: 937
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

kelly1111 wrote:Question: I want to set up the following. I want a (an event, level up in this case) to activate a teleporter. This teleporter is set to teleport an object (a chest with contents for instance from a room nearby) to where the party is. how do I tell the teleporter it should teleport its stuff to where the party is? Or Am I making this overly difficult and is there an easier way?
1) Put a teleporter on the same tile as the chest.
2) Deactivate its "teleporter" component.
3) Optionally, remove all "triggeredBy" check marks, except "triggeredByItem".
4) Create script_entity_1 with this function:

Code: Select all

function telep()
	teleporter_1.teleporter:setTeleportTarget(party.level, party.x, party.y, party.elevation)
	teleporter_1.teleporter:enable()
end
Put this code in "init.lua":

Code: Select all

defineObject{
    name = "party",
    baseObject = "party",
    components = {
        {
            class = "Party",
            
            onLevelUp = function(self, champion)
                script_entity_1.script:telep()
            end
        }
    }
}
I've tried this with a chest that contains a rock.
Problem:
Only the rock is teleported, the chest stays where it is.
And you can't pick up the rock.

Solution:
Don't use a teleporter.

Code: Select all

function telep()
	chest_1:setPosition(party.x, party.y, chest_1.facing, party.elevation, party.level)
end
Problem:
The chest is now on the same tile as the party, but chests aren't supposed to be walkable.
You can step off the tile with the chest, but if the chest has the wrong orientation, you won't be able to open it.
(for example, if it's facing a wall)
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

kelly1111 wrote:Question: I want to set up the following. I want a (an event, level up in this case) to activate a teleporter. This teleporter is set to teleport an object (a chest with contents for instance from a room nearby) to where the party is. how do I tell the teleporter it should teleport its stuff to where the party is? Or Am I making this overly difficult and is there an easier way?
What happens to the chest when it's emptied?
If it appears out of nowhere, arbitrarily blocking wherever the party is facing at the moment... it could permanently block a door or hallway.

Also, what happens if they are facing a wall when they get the XP, or if they are falling at the time?
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Ask a simple question, get a simple answer

Post by AndakRainor »

Maybe a wooden box would be less dangerous to handle :)
also, for the visual, you could spawn a "teleportation_effect" at the same position.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

AndakRainor wrote:Maybe a wooden box would be less dangerous to handle :)
also, for the visual, you could spawn a "teleportation_effect" at the same position.
^^Agreed, teleporting a wooden box (or one that looks a bit like a chest? - of which there are plenty floating around) would be easiest.

Have you considered teleporting the party to a 'level up / treasure area' instead of the other way around - again, a lot less messy
Post Reply