Display results as :

Rechercher Advanced Search


download  Source  code  

February 2018

Calendar Calendar

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

Controller scripting

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:



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

View user profile

Back to top Go down

Back to top

- Similar topics

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