Aller au contenu

Photo

snapping the player to a position after cs.


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
legrunge

legrunge
  • Members
  • 36 messages
ok i have a cs for when the player steps on a trigger it shows a contra zoom while the player cracks his knuckels then the camera rotates around the player and back and up to show the steps as he starts walking down the steps threteningly.  he comes to a stop at the end of the steps on the ground floor a bit past the last step. is there a way to snap the player into that position after the cs plays?

#2
Qutayba

Qutayba
  • Members
  • 1 295 messages
There might be more than one way, but off the top of my head, I'd say you can create a waypoint at the end position and add a line to move the pc to waypoint to the trigger script.

#3
hunharibo

hunharibo
  • Members
  • 126 messages
A cutscene can have a script associated with that fires when the cutscene ends (look in object explorer in cutscene editor with the base cutscene selected). In that script simply acquire a reference to the player (gethero for example) then look for a function (UT_jumpsomething) that teleports the player to a waypoint you previously put in that area. If you need help with this i can be more detailed.

#4
legrunge

legrunge
  • Members
  • 36 messages
yes please go on im acctualy quite pequed on this one. though i also like the first suggestion. as its simple. and im assumeing that while the cs is running the "Real level" is only running in the background.



but for reasons of experimentation i would love to learn more about the second answer to the problem.



thank you both.

#5
hunharibo

hunharibo
  • Members
  • 126 messages
Create a new script (File->New->Script) then paste the following inside it:

#include "utility_h"
#include "wrappers_h"
#include "events_h"

void main()
{
    UT_PCJumpOrAreaTransition("areaname","waypointname");
}

please note that "areaname" and "waypointname" are 2 object tags that i used only demonstrate this sample. You need to replace those with your own. In place of "areaname", put the tag of the area (in quotes) you want the player to jump to (in case you want to jump within the same area, then put the currently active area's tag here). In place of "waypointname" put the tag of the waypoint (in quotes) that you want the player to jump to (this waypoint needs to be put in the area first in the area editor. You cannot create it on the fly.) Save the script, then export it.

Now go to the cutscene editor. Look for the object inspector with nothing but your cutscene resource object selected then you will find a variable 'End Script' under the general rollout. Change this to be your new script that you just created. Save the cutscene and export it. Try it ingame. 

Modifié par hunharibo, 11 janvier 2010 - 05:59 .


#6
Craig Graff

Craig Graff
  • Members
  • 608 messages
The cutscene itself can also be set to specifically reference the character you want to move (as opposed to a dummy model), in which case they will end up where you leave them in the cutscene.



Note that this breaks if you put someone up in the air or inside of something else, in which case you will need to handle the jump through script, as well as using SetPhysicsEnabled(FALSE).

#7
madsabroo

madsabroo
  • Members
  • 259 messages
I'd like to use this effect in a cutscene, do I have to assign waypoints for henchman as well or just the player?