Page 110 of 400

Re: Ask a simple question, get a simple answer

Posted: Fri Jan 29, 2016 4:18 pm
by Slicyr
Thank you minmay, works perfectly!

Re: Ask a simple question, get a simple answer

Posted: Sat Jan 30, 2016 8:51 pm
by Hyperbog
Aight. Simple Question.

Is there a way through scripting to change the direction my party faces when transitioning from one room/map to another using stairs? In other words Is there a way to walk into the stairs say facing east, and come out facing south where the target destination is set?

Re: Ask a simple question, get a simple answer

Posted: Sat Jan 30, 2016 11:03 pm
by Sutekh
Okay, simple enough, I just have to figure out how to explain it...

1: Stairs
Make sure that the 2 stairs you're going to / from are targeting each other if they're not positioned one above the other.

2: Invisible Teleporters
Place an invisible teleporter on each stair. Set the 'initialState' to deactivate on both of them, and set the spin direction for each teleporter to face the way that the party will exit that stair.

3: Timers
Place a timer next to each stair. Set the timers to something small, such as 0.0001 seconds, uncheck the 'timer' boxes so that they won't start until they're supposed to, and check the 'disableSelf' boxes to make them stop themselves. Connect each timer to deactivate the invisible teleporter it's next to.

4: Floor Triggers
Place a floor trigger on each stair. Now the important bit: connect each floor trigger to activate the timer next to it, and also to activate the invisible teleporter on the OTHER stair.

I hope that makes sense... ;)

Re: Ask a simple question, get a simple answer

Posted: Sun Jan 31, 2016 12:18 am
by Slicyr
Sutekh wrote:1: Stairs
Make sure that the 2 stairs you're going to / from are targeting each other if they're not positioned one above the other.

2: Invisible Teleporters
Place an invisible teleporter on each stair.
Would just like to add that if you make the stairs target each other, and not the square in front of the other map's staircase, you need to set each teleporter's target to that square. Otherwise, the party will end up in the middle of the stairs, facing one of the staircase walls.

Alternatively, if your stairs already have those squares set as customTarget, then you just need to place the teleporters on those squares and not change the teleporter targets.

Basically, just make sure that the staircases place the party inside a teleporter, and that the teleporter places the party one square in front of a staircase.

Re: Ask a simple question, get a simple answer

Posted: Sun Jan 31, 2016 12:50 am
by Sutekh
If you place 2 sets of stairs normally - one above the other and aligned with each other - then you don't end up standing in the square in front of the staircase. I know some people like to do this, but I'd rather make them behave the way they do in the actual game.

Re: Ask a simple question, get a simple answer

Posted: Sun Jan 31, 2016 12:59 am
by Hyperbog
@Sutekh - Brilliant solution. Your instructions were clear, and it worked exactly as you said it would and as I wanted it to. Thanks for taking the time to help out.

Re: Ask a simple question, get a simple answer

Posted: Sun Jan 31, 2016 5:45 am
by Slicyr
Sutekh wrote:If you place 2 sets of stairs normally - one above the other and aligned with each other - then you don't end up standing in the square in front of the staircase.
I get that you might want that for stairs that do NOT rotate the party, but now we're talking about the kind that do, are we not? What I was saying was just that if you don't teleport the party to that square, they will be standing in the stairs facing one of the stairwell walls. They would then have to strafe to leave the staircase. That situation just seems a bit weird to me. Also, because of how low the camera is placed, it looks as though half the party members' feet, and the other half's whole lower bodies are clipping through the stairs. Or is that just me?
SpoilerShow
Image
You might not agree, but personally I think this just looks a lot better:
SpoilerShow
Image

Re: Ask a simple question, get a simple answer

Posted: Sun Jan 31, 2016 8:32 am
by Sutekh
Sutekh wrote:2: Invisible Teleporters
Place an invisible teleporter on each stair. Set the 'initialState' to deactivate on both of them, and set the spin direction for each teleporter to face the way that the party will exit that stair.
As long as you set the spin direction for each teleporter to point the party the same way as the stairs, then you should not end up facing the wall. That's the whole reason I added the teleporters, timers and floor triggers in the first place. :ugeek:

With my method above you should get this:
SpoilerShow
Image
And in the actual game Almost Human did it like this:
SpoilerShow
Image
So I still think my way looks better, since it matches the original game, but obviously it's a matter of personal preference. 8-)

Re: Ask a simple question, get a simple answer

Posted: Sun Jan 31, 2016 2:01 pm
by Hyperbog
I really need to, and want to, learn scripting as It's definitely a bit frustrating knowing what I want to do, but just starting out and not having the knowledge to do so. I know in time though this will become much easier.

BUT, I feel my next question requires a bit of scripting and various types of manipulation. From what I've gathered, and correct me if I'm wrong, I'll need triggers (definitely) mixed with timers, counters, and LUA.

So what I'm trying to accomplish is this:

All of where you see the spikes I'm going to have triggers. I want it so that if you walk in that space you trigger the spikes starting from the corners of the room until they meet in the center and then stop. The triggers will only apply to the side you're walking on so the whole room won't be activated just the side you walked on.

So lets say the two corner tiles on the east wall where the party walks through are Spike 7 at the top and Spike 1 at the bottom. It would go like this: 1+7 would activate, then 2+6, then 3+5, and finally the tile in front of the door 4.

Image

Re: Ask a simple question, get a simple answer

Posted: Sun Jan 31, 2016 4:40 pm
by Sutekh
Yeah, this can be a little frustrating, but it's always nice to get that eureka moment when you finally figure something out.
But anyway, what you're trying to do here won't be too difficult.

I've set up a test example in the editor similar to yours:

Image

And, like yours, I've numbered the spike traps 1-7 to make this easier to follow.

In my example, I've just placed a floor trigger in the middle of the room for testing, but obviously you can place yours on each spike trap the way you described.
As you can see, the floor trigger is connected to activate a timer. In this example, I've named the timer 'spike_trap_timer_1'. This timer has a timerInterval of 0.1 seconds, and the 'timer' box is unchecked.
You'll also see I have a script_entity, which contains the following script:

Code: Select all

spikeCount = 0
function spikeTrapSequence()
   if spikeCount == 10 then
      floor_spike_trap_1.controller:activate()
      floor_spike_trap_7.controller:activate()
   elseif spikeCount == 20 then
      floor_spike_trap_2.controller:activate()
      floor_spike_trap_6.controller:activate()
   elseif spikeCount == 30 then
      floor_spike_trap_3.controller:activate()
      floor_spike_trap_5.controller:activate()
   elseif spikeCount == 40 then
      floor_spike_trap_4.controller:activate()
   elseif spikeCount == 50 then
      spike_trap_timer_1.controller:stop()
      spikeCount = 0
      return
      end
   spikeCount = spikeCount + 1
   end
Once you have the script in place, connect the timer to the script_entity so that it will activate the 'spikeTrapSequence' when you step on the floor trigger.
You could achieve the same result with lots of timers and connectors, but this keeps things much tidier.