Cineamatic camera, event system, and folower ai. Contains quasi tutorial

upbge

(Cortu) #1

A template and quasi tutorial for cinematic games in upbge.
The main features include,

  • Cinematic cameras
  • Navmesh switching
  • Follower ai
  • Character switching
  • An event system including,
  • Buttons
  • Traps
  • Teleporter
  • Conveyor


<->
Key Binds
up: e
left: s
down: d
right: f
jump: space

switch: tab
follow: f2
stay: f3

<->
Click here for the readme.
https://www.dropbox.com/s/xe6849cbzvvfia4/cineCam.zip?dl=0&file_subpath=%2FcineCam%2Freadme.1st.txt

<->
Pictorial logic brick layout can be found here.
https://www.dropbox.com/home?file_subpath=%2FcineCam%2FcineShots&preview=cineCam.zip

<->
The quasi tutorials can be found in the game scripts as heavily annotated code. To read the code.
https://www.dropbox.com/s/xe6849cbzvvfia4/cineCam.zip?dl=0

<->
Direct download link.
https://www.dropbox.com/s/xe6849cbzvvfia4/cineCam.zip?dl=1

<->
Designed on UpBge 0.2.4
License Cortu Johnstone CC BY-SA 4.0


(blenderaptor) #2

need dropbox to download :confused:


(Cortu) #3

I’m pretty sure the direct link doesn’t need Dropbox. Dose this one work?
https://www.dropbox.com/s/xe6849cbzvvfia4/cineCam.zip?dl=1


(Camos1011) #4

There is meant to be a mouse over text system and I’ve been having the hardest time finding anything here (I guess I suck at searching for stuff).
So, I made my own really simple one.
hover text.blend (509.5 KB)


(- Click for resources) #5

I tried it out.

How the peep do you get upstairs? i managed only 1 time to climb the ladder and have no clue how i’ve done it. haha. xD

Also didn’t use the button but do they for example stop the floor from opening? i just stepped on the floor and jumped into the hallway :wink:

Anyway nicely done.

simple one? it’s how you do it with bricks only, so you done good.(could also have used messages)


(Cortu) #6

Theres a ladder to the left, a stairwell to the right and a green button left of center.
Stand next to the button and click it with the mouse. Same goes for the ladder, click it with the mouse. Both the ladder and the button have a proximity limit, so you have to be kinda close, but if you block it, then you cant click on it. The ladder in particular is a problem because I had to take it out of the corner due to some issues with character physics. Make sure you’r right in front of the ladder when you click it, not to the side. The stairwell is easy, just walk up it. The red buttons due indeed disable the trap.
I’m guessing the way you got up the ladder the first time was by clipping threw the corner, creating weird physics problems. :slight_smile:
Btw, you can change the allowable distance by changing the maxDistance property on the trigger objects.


(- Click for resources) #7

I got that part haha, i purely meant up the ladder :slight_smile:
It’s indeed a bit bugged, if you walk against the ladder/wall you kinda get pushed up to there. (i believe this has to do with friction settings in the wall and or player material).

Ah ok that’s what i wanted to know, thanks!

Thanks for the explanation.


(Camos1011) #8

I just decided to center the active player triggers and keep the ai and navmesh ones as is and move the ladder and wall further to the left more and now it works far smoother and I don’t have to worry about the following AI pushing me off the map if you move too slow.

I’m just stuck with not being able to figure out how to get the ai to teleport with the active player on both characters.


(Cortu) #9

The easiest way is to teleport them indevidualy by pressing tab and having both characters press the button. If you want them both to teleport at the same time, then your probably going to want to send a message. You’ll need some way to know who the follower is and something that sends the message. You could also have an area teleporter that telepoted every one standing in a ghost object.

target = folower
eventName = 'teleportEvent'
eventAction = 'do'
gry.msgr.say('event', [target, eventName, eventAction], 'event')

(Camos1011) #10

I was actually thinking about the area teleporter and somehow assign properties to the a collider linked with the ai True Property but, can’t get it to work.
I was also thinking that an area teleporter could be used to “fake” certain actions like entering vehicles and teleport a static vehicle and characters for a vehicle with them both jumping inside as an opening animation too. I was up all night thinking of the implications of an assignable teleporter and there are a lot.

UPDATE: earlier was wrong version -_-
https://www.mediafire.com/file/eaqze7qls2s9b5y/cineCam.rar/file


(Camos1011) #11

Can those lines be added in-engine or through Python app only? I tried it and it didn’t work and wasn’t quite sure where to put it. I tried below the last line for teleporting within gryTriggie.py and under line 37 too.


(Cortu) #12

The problem is that you have to know who the follower character is. Thats who fills the target argument. Making a trigger is or less like this.

  1. Have a way that the event triggers. Like walking over a particular area, pushing a button or something dies, etc.
  2. Decide who or what triggered the event.
  3. Send a trigger message to a triggie message receiver.
  4. The triggie then decides what should actually be done.

The problem with teleporting the follower is that its not the one that triggering the event. So you have to store the follower somewhere.

  1. When the button is clicked, gryTrigger.gryTrigger.Button.input runs.
  2. Each time you switch characters you send a currentCharacter message. This is handled in gryCine.cineChar.CineamaticCharature.input. The trigger then receives the currentCharacter message in gryTrigger.gryTrigger.Trigger.message and stores it in self.target. The button then runs self.do(self.target). This sends an event message.
  3. That message is received by gryTrigger.gryTriggie.Triggie.message. If eventAction == ‘do’, then the triggie runs self.do(target).
  4. The do method for teleporting is defined as gryTrigger.gryTrigger.TeleportTriggie.do.

Each step of the way is defined separately so that its easier to customize, but it means that you have to trace each step.

One way to teleport the follower is to send a currentFollower message and have it received and stored in the same way the target is. Then when the button is pressed you could run self.do(target); self.do(target0). You could also make target a set and run do with a for loop.

Maybe the easiest way would be to store the follower in the Global Dictionary.


(Camos1011) #13

Wouldn’t it be easier to just have the follower step on a trigger that teleports the follower individually? I don’t need to have the player and follower do the same thing at exactly the same time. Just where necessary with designated triggers. Much like the ladder system. The distance between follower and main make it possible to sometimes just click the ladder at the top to call the follower up. I’m not sure if that was intentional but, it’s cool regardless!