Latest topics
» Shader instructions editor
Today at 7:14 am by kohedlo

» Two player (console) game in five hours
Today at 12:11 am by kohedlo

» Howdy I am Night Hawk
Yesterday at 9:21 am by kohedlo

» "Imperial Game Engine" USP
Sat Dec 09, 2017 12:15 pm by kohedlo

» Russian anorher Chernobyl at end 2017
Sat Dec 09, 2017 1:24 am by kohedlo

» [2.7.X] fog
Fri Dec 08, 2017 10:48 pm by kohedlo

» Support for High moral standarts
Fri Dec 08, 2017 6:00 pm by kohedlo

» New Licensing
Fri Dec 08, 2017 12:06 pm by kohedlo

» "Imperial Game Engine 2.7.1 (aka )"(15 december 2017 stable update released)
Fri Dec 08, 2017 11:34 am by kohedlo


Display results as :

Rechercher Advanced Search


Source  code  download  

December 2017

Calendar Calendar

Создать форум
Top posting users this week

Controller scripting

View previous topic View next topic Go down

Controller scripting

Post by kohedlo on Wed Jun 24, 2015 4:44 am

Result: make simple character controller for FPS, TPS or Racing game type.

Implemention: For character controller we can use iscene template ass class of our controller.

- First need dragg animated imodel on our iscene.
- Secont script input events by connection with moving and animation playing action functions.

-import model and textures in resource packet.
- prepare imodel: open in model editor, set size, fetch geometry, save imodel.

In preferences we must set IS3DSTATIC preference to OFF.

Lets add model on map iscene.

Next lets script our controller iscene:

- for open iscene script need check LawMaker EDIT property in iscene preferences.

For catching input we can use [events/input/OnKey.ifn] script event node. In node preference we sets keyboard key that we wish.

Next we cteate moving model by fact throught [actions/actors/translate_actor.ifn and actions/actors/rorate_actor.ifn] script methods. For this we nees set actor instance that need move [variables/instances/IScene_Actor.ifn] (before creating instance of actor imodel we must select imodel in scene tree.)

Second add to our moving soldier function soundplaying of soldier steps.

Cathing input event - when key down (first port) process  start play sound. Please note that in preference sound variable we can set loop playing preference for short soundfiles. When move key in state UP (Released) (second event port)- we connect port by connector with stop playing port in SoundPlayer action method.

And last we add in our moving character function element of playing skeletak animation throught [action/animation/PlayAnimation(imodel_skeletal).ifn]

For this action function need two wariables. 1- imodel of soldier in our scene. 2 animation name. For last we must select animation in ModelEditor.

At end we save our scene and run ineditor game simulation.

Result in next video:

Demo packet of this tutorial you can download there:



Сообщения : 980
Experiance Points : 2268
Reputation : 2
Дата регистрации : 2009-08-30

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum