Page 222 of 396

Re: Ask a simple question, get a simple answer

Posted: Sat Mar 10, 2018 10:46 am
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.

Re: Ask a simple question, get a simple answer

Posted: Sun Mar 11, 2018 8:44 am
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.

Re: Ask a simple question, get a simple answer

Posted: Sun Mar 11, 2018 8:50 am
by Isaac
Upload the model, and I'll look at it.

Re: Ask a simple question, get a simple answer

Posted: Mon Mar 12, 2018 3:51 am
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.)

Re: Ask a simple question, get a simple answer

Posted: Tue Mar 13, 2018 1:06 pm
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?

Re: Ask a simple question, get a simple answer

Posted: Tue Mar 13, 2018 1:55 pm
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...

Re: Ask a simple question, get a simple answer

Posted: Tue Mar 13, 2018 7:39 pm
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)

Re: Ask a simple question, get a simple answer

Posted: Tue Mar 13, 2018 8:59 pm
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?

Re: Ask a simple question, get a simple answer

Posted: Tue Mar 13, 2018 9:09 pm
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.

Re: Ask a simple question, get a simple answer

Posted: Wed Mar 14, 2018 10:07 am
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