Modding, Mission Design, and Coding > The FRED Workshop

"Has the player touched the controls?"-check, help needed

(1/3) > >>

0rph3u5:
So, I am currently workshopping an exploration focussed mission, based off this (seems like you need a spoonful of sugar, fine).

And to make it more interesting, I though I would try *something*. Part that something would be to check if the player has touched the controls, while they are flying through the area and chasing those elusive signals.

While I can do that with key-pressed SEXP for almost everything, there seems no way to do that when comes in input from the mouse or joystick - there is no axis-pressed. What I came up with is doing repeated events that save the orientation at time t in a set of variables and then at t+x check the orientation at t+x against the one at t, and see if a change occurred.
That however runs into an issue with if input is contained to the time between t and t+x and player actually manages the feat of precisely go back to their previous orientation; esspecially if I suspend the check for a time, e.g. if they are in proxmitry of the one of the objects they are supposed to find.

A is-facing check is out of the question because I want the player to navigate somewhat blind.


Anyone got a better idea?

0rph3u5:
Come on, people! - Anything?

General Battuta:

--- Quote from: 0rph3u5 on February 29, 2020, 08:30:46 am ---That however runs into an issue with if input is contained to the time between t and t+x and player actually manages the feat of precisely go back to their previous orientation; esspecially if I suspend the check for a time, e.g. if they are in proxmitry of the one of the objects they are supposed to find.

--- End quote ---

Constantly run the check, add the deviation from the desired orientation to a variable, if it's >0 you know they've moved.

0rph3u5:
There is no target deviation to hit (that would have just explode in terms of possible error sources) - the idea is completly "check if the player is idle" while flying from point a to point b.

Mabye some context will help:
Spoiler:Basically what is going on is, the following: the player will search an area for signals (there are 12 of them; and depending on the difficulty a certain target number to be found: 4/6/8/10/12). The player gets a HUD gauge to help them point into the right direction, a basic "its getting warmer"-type.

If the player is idle during the travelling, at hidden counter called INFLUENCE will go up. The gain of INFLUENCE is modified by proximitry to at set of envoirnmental hazards and is suspended if the player is close to a signal. Depending on how this shakes out I might even have the INFLENCE gain be modified by the duration the player is idle. I decided against a difficulty modifier and instead just increased the ammount of targets to be found.
If INFLUENCE reaches certain goals, *events will happen* and *indicators will appear*. If INFLUENCE exceeds a limit, the mission fails (a debrief by an external narratior cues you in what happened, and gives you a clue how to avoid it).
The idea is for INFLUENCE to make the mission more interesting but also be something scary; and to have the player themself decide "how close to the edge" they want to go.

The way this works out also is essential to be way, I can design slow decrease of INFLUENCE. Currently I only do a subtract INFLUENCE each time a signal is found.

X3N0-Life-Form:
Well, you could check if the player's orientation changes in short intervals, something like:

--- Code: ---if player speed > 0 then
  compare current pitch bank & heading with previously stored values
  if they're different then
    do something
  end if
  store pitch bank & heading into 3 variables
end if

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version