MegaKerma / Silent Walk FPS Creator / Silent Walk: RENAISSANCE

Tools for creating 3D games
It is currently Thu Nov 15, 2018 10:51 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: GO FISHING? ^__^
PostPosted: Mon Nov 24, 2014 11:25 pm 
Offline
Registered member
Registered member
User avatar

Joined: Sun Nov 09, 2014 10:40 am
Posts: 5
Location: Saint Petersburg, RUSSIA
Hi to everyone! My name is Vill and today I want to tell you about my point of view on character animation in MEGAKERMA Game Maker 3.0) And I'll start with a simple example... with a crucian. It have only a few animation frames, called "swim" yet, but it can breathe a new life into static MegaKerma's world)

First I want to tell thanks to:
  • URL is hidden from guests, please register and login to view the hyperlink for creating MegaKerma
  • google translate for help in translating this text
  • All members MegaKerma's forum for tips and tutorials

OK! As you all knows, MegaKerma has not(unfortunately) separate function to create an AI/NCP/Creature(( I'm still waiting new URL is hidden from guests, please register and login to view the hyperlink, that Zoltan promised, but...
Next. Another bad news is: we can't use variables in any KermaScript functions( For example function
Code:
SET A AS 5
CREATERANDOM B 1 6
IF A > B
  //Do some thing
ENDIF

will not work, because IF-function compare only variable with a number/string, but not a variable with a variable. Also I can't catch position of the specified object and I can't use it global position in script. For example
Code:
someObject.xPos

But how can I make a random-traveled-NPC (for example fish)?

Let's try!
  1. Start new project in MegaKerma. Add animated model(crucian in b3d format in my case) into the library of models. Add the textures for loaded models. Select the specified model into the library and click RMB on it, then check the checkbox "Has animation". Next go to the "Scenes"
  2. Add some area you'd like. Add the animated object and call it fish01(for this tutorial). Add five cones and set it's segments to 3. Call these cones "target_01_01", "target_01_02"..."target_01_05" and set scale for it to 1.0 1.0 1.0
    Image
    Go to the Events inset and type into Creation event
    Code:
    SETOBJECTALPHA self 0
  3. Go into fish01 Creation Events inset and type
    Code:
    GOSUB createFish
    . Then into Command sets create new scripts: "createFish",
    Code:
    CREATEANIMATION self swim 0 39 1 //from frame 0 to 39 loop
    PLAYANIMATION swim 1

    SET self.newCycle AS 0
    GOSUB selectNextPoint


    "selectNextPoint",
    Code:
    CREATERANDOM self.nextPoint 0 4
    IF self.nextPoint = 0
       MOVETO target_01_01 100 1 setCycle //reach target with 100 steps
    ENDIF

    IF self.nextPoint = 1
       MOVETO target_01_02 100 1 setCycle
    ENDIF

    IF self.nextPoint = 2
       MOVETO target_01_03 100 1 setCycle
    ENDIF

    IF self.nextPoint = 3
       MOVETO target_01_04 100 1 setCycle
    ENDIF

    IF self.nextPoint = 4
       MOVETO target_01_05 100 1 setCycle
    ENDIF

    SET self.newCycle AS 0

    "setCycle"
    Code:
    SET self.newCycle AS 1
  4. Go to fish01 Step event and type
    Code:
    IF self.newCycle = 1
       GOSUB selectNextPoint
    ENDIF
    Image
  5. Set position for all 01_01...01_05 targets as you like and run the game. Now you have random-move to five points fish

if you have a questions or suggestions how to improve this scripts, please answer in this topic))
Image
And if I uploaded it right, URL is hidden from guests, please register and login to view the hyperlink


Top
 Profile  
 
 Post subject: Re: GO FISHING? ^__^
PostPosted: Fri Dec 05, 2014 5:09 am 
Offline
Registered member
Registered member

Joined: Thu May 28, 2009 3:52 pm
Posts: 1083
Location: Massachusetts
Hi Vill! This is some really interesting stuff you've got going on here. I'm impressed with what you've done to the code!

_________________
Image
URL is hidden from guests, please register and login to view the hyperlink


Top
 Profile  
 
 Post subject: Re: GO FISHING? ^__^
PostPosted: Fri Dec 05, 2014 8:56 pm 
Offline
Registered member
Registered member
User avatar

Joined: Sun Nov 09, 2014 10:40 am
Posts: 5
Location: Saint Petersburg, RUSSIA
Thanx) I see great potential in MegaKerma and trying to revive my fantasy in it)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group