551

(0 replies, posted in Gossip)

Found a good resource for sound effects:

http://www.pacdv.com/sounds/ambience_sounds.html

Another, and better resource:

http://www.pdsounds.org/library_usersort?page=18

552

(10 replies, posted in Scripting)

Now we can MOVE,JUMP,SPIN,ANIMATE, and MAKE SOUND!

box=getObject("cube")
man=getObject("man")
monkey = getObject("monkey")
cone = getObject("cone")
person = getObject("person")
steps = getObject("steps")
-------------------------------[[MOVE]]---------------------------
--translate(object,direction,"local")
--onKeyDown(key)
--onKeyUp(key)
--setAnimationSpeed(object, speed)
--playSound(object)
--pauseSound(object)
--stopSound(object)
--getSoundGain(object)
--setSoundGain(object, gain)


move_object =         box
move_speed =        .1
move_forward =        vec3(x, -move_speed, z) --[1]
move_backward =    vec3(x, move_speed, z) --[2]
move_left =        vec3(move_speed, y, z) --[3]
move_right =        vec3(-move_speed, y, z) --[4]
move_down=        vec3(x, y,-move_speed) --[5]
move_up=            vec3(x, y, move_speed) --[6]
move_direction =        {move_forward,move_backward,move_left,move_right,move_down,move_up}
move_btn =         {move_btn_U,move_btn_D,move_btn_L,move_btn,R}
move_btn_U =        "W"
move_btn_D =        "S"
move_btn_L =        "LEFT"
move_btn_R =        "RIGHT" 
move_animation =    1
idle_animation =         0
move_animation_speed =  2
idle_animation_speed = .5
move_sound = steps

function Move(move_object,move_direction,move_btn,move_animation,idle_animation)
    if isKeyPressed(move_btn) then
        changeAnimation(move_object,move_animation)
        translate(move_object,move_direction,"local")
        setAnimationSpeed(move_object, move_animation_speed)
    end    
    
    if onKeyDown(move_btn_U) then
        playSound(move_sound)
    end
    
    if onKeyUp(move_btn) then
        changeAnimation(move_object,idle_animation)
        setAnimationSpeed(move_object, idle_animation_speed)
        stopSound(move_sound)
    end
    
end

-------------------------------[[JUMP]]---------------------------
--translate(object,direction,"local")
col = getNumCollisions(jump_object)
jump_object =         box
jump_height =         3
jump_speed =         1
jump_btn =         "SPACE"
jump_animation =    changeAnimation(object, animationId)
jump_direction =         {jump_up,jump_down,jump,left,jump_right}
jump_up =            vec3(x, y, jump_speed*jump_height) 
jump_down =        vec3(x, y, jump_speed*jump_height) 
jump_left =            vec3(-jump_speed*jump_height, y, z) 
jump_right =        vec3(jump_speed*jump_height, y, z) 

collisions = getNumCollisions(box)

function Jump(jump_object,jump_direction,jump_btn--[[,jump_animation]])
    if isKeyPressed(jump_btn) then
        --changeAnimation(jump_object,jump_animation)
        addCentralForce(jump_object, jump_direction, "local")
    end
end

-------------------------------[[SPIN]]-------
--rotate(object,direction,angle,"local")
spin_speed =        7
spin_object =         box
spin_direction =        {spin_left,spin_right}
spin_left =             vec3(x, y, spin_speed)
spin_right =        vec3(x, y, -spin_speed)
spin_btn =            {spin_btn_L,spin_btn_R}
spin_btn_L =        "A"
spin_btn_R    =        "D"
spin_animation =        changeAnimation(object, animationId)



function Spin(spin_object,spin_direction,spin_btn)
    if isKeyPressed(spin_btn) then
        --changeAnimation(spin_object,spin_animation)
        rotate(spin_object,spin_direction,spin_speed,"local")
    end    
end


changeAnimation(person,0)
stopSound(steps)

------GAME---
function onSceneUpdate()
--Jumping Box
    Jump(box,jump_up,jump_btn)
    
    
    Move(box,move_direction[1],move_btn_U)
    Move(box,move_direction[2],move_btn_D)
    Move(box,move_direction[3],move_btn_L)
    Move(box,move_direction[4],move_btn_R)
    
    Spin(box,spin_left,spin_btn_L)
    Spin(box,spin_right,spin_btn_R)
----------------------------------------------------------------
--Jumping Person
    Jump(person,jump_up,jump_btn)
    
    
    Move(person,move_direction[1],move_btn_U,move_animation,idle_animation)
    Move(person,move_direction[2],move_btn_D,move_animation,idle_animation)
    Move(person,move_direction[3],move_btn_L,move_animation,idle_animation)
    Move(person,move_direction[4],move_btn_R,move_animation,idle_animation)
    
    Spin(person,spin_left,spin_btn_L)
    Spin(person,spin_right,spin_btn_R)    
    --See(cone,monkey)

end
--------------------------

553

(17 replies, posted in Gossip)

Updated the Rig to be used with MakeHuman meshes.
It is a Blender File.
It has Inverse Kinematics(IK) for the hands and feet.
The hip and hip_root bones let you rotate the hips more naturally.
It also has knee and elbow pole targets.
I also left in a female walk cycle in the pose library

PunBB bbcode test
PunBB bbcode test

DOWNLOAD:
https://sites.google.com/site/aasfsfasa … ameRig.zip

554

(44 replies, posted in Scripting)

PunBB bbcode test

Now that I have finished the basics of my Customizable Game Script:

http://forum.maratis3d.com/viewtopic.php?id=744 (See the last post)



I am going to start on an artificial intelligence system:

http://forum.maratis3d.com/viewtopic.php?pid=4521#p4521

I will post the progress here.

A post on gamedev.net

http://www.gamedev.net/topic/651885-pro … -5-senses/

Senses System First Person

Download:
https://sites.google.com/site/maratisfi … System.zip

Senses System 3rd Person:

https://sites.google.com/site/maratisfiles/files/Screenshot%20%28952%29.png

Download:
https://app.box.com/s/b2etg5w53twc4lv4cnmp

555

(10 replies, posted in Scripting)

Now You can MOVE JUMP and SPIN:

box=getObject("cube")

monkey = getObject("monkey")

-------------------------------[[MOVE]]---------------------------
--translate(object,direction,"local")
move_object =         box
move_speed =        .2
move_forward =        vec3(x, -move_speed, z) --[1]
move_backward =    vec3(x, move_speed, z) --[2]
move_left =        vec3(move_speed, y, z) --[3]
move_right =        vec3(-move_speed, y, z) --[4]
move_down=        vec3(x, y,-move_speed) --[5]
move_up=            vec3(x, y, move_speed) --[6]
move_direction =        {move_forward,move_backward,move_left,move_right,move_down,move_up}
move_btn =         {move_btn_U,move_btn_D,move_btn_L,move_btn,R}
move_btn_U =        "W"
move_btn_D =        "S"
move_btn_L =        "LEFT"
move_btn_R =        "RIGHT" 
move_animation =    changeAnimation(object, animationId)


function Move(move_object,move_direction,move_btn)
    if isKeyPressed(move_btn) then
        --changeAnimation(move_object,move_animation)
        translate(move_object,move_direction,"local")
    end    
end

-------------------------------[[JUMP]]---------------------------
--translate(object,direction,"local")
jump_object =         box
jump_height =         3
jump_speed =         1
jump_btn =         "SPACE"
jump_animation =    changeAnimation(object, animationId)
jump_direction =         {jump_up,jump_down,jump,left,jump_right}
jump_up =            vec3(x, y, jump_speed*jump_height) 
jump_down =        vec3(x, y, jump_speed*jump_height) 
jump_left =            vec3(-jump_speed*jump_height, y, z) 
jump_right =        vec3(jump_speed*jump_height, y, z) 

collisions = getNumCollisions(box)

function Jump(jump_object,jump_direction,jump_btn--[[,jump_animation]])
    if isKeyPressed(jump_btn) then
        --changeAnimation(jump_object,jump_animation)
        addCentralForce(jump_object, jump_direction, "local")
    end
end

-------------------------------[[SPIN]]-------
--rotate(object,direction,angle,"local")
spin_speed =        7
spin_object =         box
spin_direction =        {spin_left,spin_right}
spin_left =             vec3(x, y, spin_speed)
spin_right =        vec3(x, y, -spin_speed)
spin_btn =            {spin_btn_L,spin_btn_R}
spin_btn_L =        "A"
spin_btn_R    =        "D"
spin_animation =        changeAnimation(object, animationId)



function Spin(spin_object,spin_direction,spin_btn)
    if isKeyPressed(spin_btn) then
        --changeAnimation(spin_object,spin_animation)
        rotate(spin_object,spin_direction,spin_speed,"local")
    end    
end

function onSceneUpdate()

    Jump(box,jump_up,jump_btn)
    
    Move(box,move_direction[1],move_btn_U)
    Move(box,move_direction[2],move_btn_D)
    Move(box,move_direction[3],move_btn_L)
    Move(box,move_direction[4],move_btn_R)
    
    Spin(box,spin_left,spin_btn_L)
    Spin(box,spin_right,spin_btn_R)

end
--------------------------

556

(10 replies, posted in Scripting)

Now we can JUMP!:

box=getObject("cube")

--translate(object,direction,"local")
jump_object =         box
jump_height =         3
jump_speed =         1
jump_btn =         "SPACE"
jump_animation =    changeAnimation(object, animationId)
jump_direction =         {jump_up,jump_down,jump,left,jump_right}
jump_up =            vec3(x, y, jump_speed*jump_height) 
jump_down =        vec3(x, y, jump_speed*jump_height) 
jump_left =            vec3(-jump_speed*jump_height, y, z) 
jump_right =        vec3(jump_speed*jump_height, y, z) 



function Jump(jump_object,jump_direction,jump_btn--[[,jump_animation]])
    if isKeyPressed(jump_btn) then
        --changeAnimation(jump_object,jump_animation)
        addCentralForce(jump_object, jump_direction, "local")
    end
end


function onSceneUpdate()

    Jump(box,jump_up,jump_btn)

end

557

(17 replies, posted in Showcase)

heartseed wrote:

Cube 2 is pretty decent overall actually, though the 'editing' in some ways leaves alot to be desired, but overall the editing is pretty amazing in what you can do. Never tried just cube engine itself per se, but platinum arts sandbox engine isn't half bad actually in some ways and they are actually working on improving it.

It was a long time ago when I used it. Hopefully it is much better. It looked like Doom 95 then. hehe

558

(3 replies, posted in Showcase)

I updated the file. The cube, cylinder,and cone(not shown but included) needed an edge split so that the faces render correctly.

559

(17 replies, posted in Showcase)

SadWolf wrote:

Actually I love maratis cause you can do more with less...
If you use complex libraries, it's painfull to learn everything, even simple things takes a lot of work...
maratis is very easy and usually most common things has a lua function,
and anyway having a tool like the maratis editor makes the job done faster.

All libraries in maratis are already togheter: audio, graphics and physics... this make it a complete game engine

So why do I like maratis?
-cause is _easy_ ,
-is fast for _prototyping ideas_
-no complex setup, just download the zip e start lua code
-perfectly compatible with blender ( which works good on linux )
-easy plugin system to extend the game engine with new funcitons
-good builtin editor

smile

I agree! I have been through hundreds of software, even old software no one probably knows of. I think the first game engine I messed around with some time ago was the cube engine with a game named Saubraten or something. It was terrible.

Anyhow, all the things you have mentioned are the reason I like this engine so much. BTW, nice job!.

560

(10 replies, posted in Scripting)

Testing out my new MOVEMENT abilities:

monkey = getObject("monkey")
box = getObject("cube")

--translate(object,direction,"local")
move_object =         monkey
move_speed =        .2
move_forward =        vec3(x, -move_speed, z) --[1]
move_backward =    vec3(x, move_speed, z) --[2]
move_left =        vec3(move_speed, y, z) --[3]
move_right =        vec3(-move_speed, y, z) --[4]
move_down=        vec3(x, y,-move_speed) --[5]
move_up=            vec3(x, y, move_speed) --[6]
move_direction =        {move_forward,move_backward,move_left,move_right,move_down,move_up}
move_btn =         {move_btn_U,move_btn_D,move_btn_L,move_btn,R}
move_btn_U =        "UP"
move_btn_D =        "DOWN"
move_btn_L =        "LEFT"
move_btn_R =        "RIGHT" 
move_animation =    changeAnimation(object, animationId)


function Move(move_object,move_direction,move_btn)
    if isKeyPressed(move_btn) then
        --changeAnimation(move_object,move_animation)
        translate(move_object,move_direction,"local")
    end    
end

function onSceneUpdate()

    Move(monkey,move_forward,move_btn_U)
    Move(monkey,move_backward,move_btn_D)
    Move(monkey,move_left,move_btn_L)
    Move(monkey,move_right,move_btn_R)
    
    
    Move(box,move_direction[1],move_btn_U)
    Move(box,move_direction[2],move_btn_D)
    Move(box,move_direction[3],move_btn_L)
    Move(box,move_direction[4],move_btn_R)
    

end

561

(3 replies, posted in Showcase)

Just a set of primitives in the .MESH format. Put them in your meshes folder.

These are useful for testing scripts and rendering.


PunBB bbcode test

Download:

https://www.dropbox.com/s/80rnho3qhqn18 … itives.zip

562

(6 replies, posted in Showcase)

Thanks for that link damvcoool!

563

(6 replies, posted in Showcase)

Poodle wrote:

Well, I tend to use Sketchup as a quick outliner for buildings, but then I import into Blender for any finishing. The problem (as I see it) with Sketchup models is that they LOOK like Sketchup models unless you do a whole host of other work - in which case you may as well be doing that work in Blender.

Having said that, a lot of Blender complexity is still a mystery to me. I begin any model apart from buildings in a old copy of Silo 3D (I would use Wings 3D, but it no longer runs on an up-to-date Ubuntu installation). Come to think of it, I use a lot of software merely to avoid Blender, and then use Blender as a final polishing tool. Maybe it's time I stopped being lazy and really got to grips with the Blender interface.

In general, then - yes. Any tool I can find which is easy to use and does a job well is fine by me.

I have some Blender tutorials on my site:

www.tutorialdoctor.weebly.com

If you go to ART/3D ART APPLICATIONS and then the BLENDER tab. I also have info on Google sketchup (Which I have been using to make my buildings for Maratis)

I had to force myself into Blender too and it is not as annoying as it used to be, but I still get annoyed. The way things are designed don't help establish a good worfklow. But it's all I can afford (free).

564

(10 replies, posted in Engine)

com3D wrote:

Currently everyone using Maratis is building its own bricks/behaviors and in some way we are all wasting a lot of time as we certainly have the same basic needs and coding the same basic stuff (player/camera behavior, enemy behavior, particle emitters, fight, ...).

That's why I was really enthusiastic with Nistur's MScriptableBehavior plugin because we could have shared some game logic in a friendly way, giving ready-to-use bricks that can be easily tweaked, satisfying both beginners and seasoned programmers.

That's part of the reason I'm working on the customizable game script. Mainly to help me make things faster. One thing I need however is a particle system.

I don't quite know how to use plugins yet.

565

(6 replies, posted in Showcase)

Are you using sketchup to make your models?

566

(10 replies, posted in General)

Thanks Argoon! I completely overlooked just making it in 2D (Im thinking too 3d). I am going to look up some tutorials on how people make game menus. I was wondering how I would get animation in it. I tried using a texture animation in blender, but maybe there is an easier way.

Ill look into it. smile

567

(8 replies, posted in Scripting)

take care. smile

568

(8 replies, posted in Scripting)

Argoon wrote:

Hello guys i was able to fake a mouse over script here, i change the cursor image by a hand image when i mouse over a object, i use the rayhit function to detect the object and i just activate or deactivate a fake cursor (a plane with a image with emission on and a follow plus lookAt behavior, that is right in front of the camera) when the ray detects the object i want the cursor changes, works fantastically.

But now i have a question, from my inexperienced point of view, every time i want to make a object "mouse over" enabled, i need to make individual functions to all new objects (with repeated code), imo if true this would be unmanageable with so many different interactive objects on a scene, (and the script would be very confusing and big), but if i add a way to Tag a object then this would not be a major problem, does it?  Because i think only one function would work for all objects with different names but tagged for example "interactive".

for example a getTag() function would be nice but has it doesn't exist, at least i don't see it anywhere, what can you guys suggest that i do? Do i really need to make a bunch of functions for every object on my level that i want interactive or there's a more easy way?

What you really want is a CLASS. This is part of the reason I made my post on how to make classes in lua. Anael also responded with a link to the wiki.

Also, have you seen the:

getProjectedPoint(object, point)

function?

I think that has something to do with the mouse also.

On Classes:

Classes are just what they sound like. An apple belongs to the class of FRUIT, and so does an orange. A man belongs to the class of HUMANS, and so does a woman.

Fruit also have various properties, like TASTE and COLOR and TYPE. These would be variables in the class. And humans have various properties also, like a NAME and an AGE and a RACE. Humans also have ABILITIES. Humans can WALK, and TALK, and JUMP, etc. These would be functions in the class (Also called METHODS).

So if I were to create a new variable named manzana, and I made it part of the fruit class, I could just give it properties and abilities without having to type out the function over and over for a new fruit.

When you make variables that have these abilities and properties they are called OBJECTS.

Example:

--We make joe a person
joe = newPerson()

--now we can do stuff with joe
joe:Walk()
joe:Speak()
joe:Dance()

print (joe.name)
print (joe.age)
print (joe.height)

--create another person
sara= newPerson()
sara:Speak()
sara:Dance()
sara:Walk()

print (sara.height)
print (sara.age)
print (sara.name)

And we could keep doing this over and over and over.

569

(10 replies, posted in General)

I need to have CUT SCENES, MENUS and LEVELS in my game.

Would it be best to make a menu as a scene or as a level?

If I made it as a scene, could I access it from another level?

570

(10 replies, posted in Tutorials/Examples)

255 wrote:

Tutorial Doctor, that's nice.

Tutorial Doctor wrote:

If I can get a smooth workflow going (I am really close), then I can make a BEGINNING to END Maratis tutorial.

Try not to "overdo" though, it's better to make indipendent tutorials/examples for specific things and "release" them soon, you can't cover really everything anyway so you may feel like something is always missing. You can always make a "mega-pack" in the future. If you put your daily discoveries in the Wiki in a readable form that will be better than holding everything for the "ultimate tutorial". I see that you're learning Blender and all the other things that encompasses Maratis, so every new thing you learn you could make a wiki page. Just IMHO. smile


I think it was you that sent me the link to the wiki, but truly, I don't know how to add things to it. I saw a login button which said I need to get permission. Also, is there a standard for wiki entries? Wiki is a new thing to me (as far as editing goes).

I am really trying to get a workflow, and create this Customizable Game script so I can use it to make games faster. Blender is my main hold up. I need it to work every time (I can't get my animations into Maratis every time without any trouble yet).

Main thing is, I don't want to make a tutorial that has flaws. I need to get it working myself first. I post my achievements in the showcase area, and my scripts in the script area. The reason I posted the script as I progress is because there is no telling how long I will be coming to the site, and I want to make a foundation that someone else can build on.

Once I am able to get things set up easily, I will start releasing projects.

571

(10 replies, posted in Tutorials/Examples)

I have been thinking of making a tutorial on Maratis, as I have just found an even better workflow. I am also making a Customizable game script, so that new comers can get started easily.

This is my showcase:
http://forum.maratis3d.com/viewtopic.php?id=738

If I can get a smooth workflow going (I am really close), then I can make a BEGINNING to END Maratis tutorial.

I am more into creating TOOLS rather than creating assets. For instance, I would rather create an easily modifiable mesh so that anyone can take that and make their own.

If you were to make a sample script that utilized every IMPORTANT function that might be used for a game (also well commented), that would be all I would need to make my own stuff (like a road map).

That's why I am working on the Customizable game script.

572

(8 replies, posted in Engine)

Thank you anael! good info! I was wondering if you would check out  the Customizable Game Script I am working on in the scripting forum. I am actually using your engine to learn these things, as it is the best I have found to practice programming.

The link to that post is here:

http://forum.maratis3d.com/viewtopic.php?id=744

573

(2 replies, posted in Scripting)

anael wrote:

did you look at this exemple in the wiki ?
http://wiki.maratis3d.org/index.php?tit … ng_example

I made it to show how to create a class-like object.


Hehe. I guess I didn't read that part. Thank you!!

574

(10 replies, posted in Scripting)

Okay. This is PHASE TWO: "Digging through the API":




--CLASSES--
-------------------------------[[PERSON]]----------------------------------------

--Create()        --Creates the mesh for the new man (can be woman also)
--Move        --Makes the man able to move
--Jump()         --Makes the man able to jump
--Spin()         --Makes the man able to move spin
--Physical()        --Makes the man physical

--See()         --Makes the man able to see
--Hear()         --Makes the man able to hear
--Touch()         --Makes the man able to touch
--Taste()         --Makes the man able to taste
--Smell()
--------------------------------------
--New Person Class
[[CLASS]]    function Person(name,age)
            local object = {}
            
            object.name = name
            object.age = age
            
            function object:sayName()
                print (object.name)
            end    
                
            return object
        end

--Create Joe
local joe = Person("Joe",24)

--Create Bill
local bill = Person("Bill",25)

--Print Joe's name
print (joe.name)

--Make Bill say his name
bill:sayName()
------------------------------------------------------------------------------

-------------------------------[[ANIMATION]]-----------------------
--Methods
--changeAnimation(object, animationId)

end
-------------------------------[[CUTSCENE]]-----------------------
--Methods:
--changeScene(scene)
--object:Play()
--object:Stop()
--object:Pause()

function Play(scene)
    changeScene(scene)
end


--Class Variables:
--object.length
-------------------------------[[CHARACTER]]-----------------------
--Methods
--object:Generate()

--Class Variables:
--object.name
--object.height

-------------------------------[[PROP]]-----------------------
--Methods
--object:Create()
--object:Destroy()
function Create(object)
    activate(object)
end

function Destroy(object)
    deactivate(object)
end

--Class Variables:
--object.length
-------------------------------[[MENU]]-----------------------
--Methods
--object:Start()
--object:End()

function Start()

end

function End()

end

--Class Variables:
--object.length
-------------------------------[[LEVEL]]-----------------------
--Methods
--object:Begin()
--object:Finish()

function Begin(level)
    loadLevel(level)
end

function Finish(level)
    loadLevel(level)
end
--Class Variables:

-------------------------------[[CLOTH]-----------------------
--Methods
--object:Simulate()

--Class Variables:

-------------------------------[[LIGHT]-----------------------
--Methods
--object:TurnOff()
--object:TurnOn()
--object:ChangeColor()
function TurnOn(light)
    activate(light)
end

function TurnOff(light)
    deactivate(light)
end

function ChangeColor(light,color)
    setLightColor(light,color)
end
--Class Variables:
--object.color
--object.state
--object.brightness
--------------------------------------------------------------------

--VARIABLES--
-------------------------------[[JUMP]]---------------------------
--translate(object,direction,"local")
jump_height =         3
jump_speed =         1
jump_btn =         "SPACE"
Jump_animation =    changeAnimation(object, animationId)
-------------------------------[[MOVE]]---------------------------
--translate(object,direction,"local")

move_forward =        vec3(x, y, move_speed) --[1]
move_backward =    vec3(x, y, -move_speed) --[2]
move_left =        vec3(-move_speed, y, z) --[3]
move_right =        vec3(move_speed, y, z) --[4]
move_down=        vec3(x, -move_speed, z) --[5]
move_up=            vec3(x, move_speed, z) --[6]
move_direction =        {move_forward,move_backward,move_left,move_right,move_down,move_up}
move_speed =        1
move_btn =        "UP" 
move_animation =    changeAnimation(object, animationId)
-------------------------------[[SPIN]]---------------------------
--rotate(object,direction,angle,"local")
spin_direction =        vec = vec3(x, y, z)
spin_left =             vec = vec3(-spin_speed, y, z)
spin_right =        vec = vec3(spin_speed, y, z)
spin_speed =        1
spin_btn =        "RIGHT"
spin_animation =        changeAnimation(object, animationId)
-------------------------------[[PHYSICAL]]---------------------------
gravity =             setGravity({x, y, z})
linear_damping =         setLinearDamping(object, damping)
angular_damping =     setAngularDamping(object, damping)
linear factor =         setLinearFactor(object, {x, y, z})
angular_factor =         setAngularFactor(object, factor)
mass =             setMass(object, mass)
friction =             setFriction(object, friction)
restitution =         setRestitution(object, restitution)
-------------------------------[[SEE]]---------------------------
--isCollisionTest(object)
--isCollisionBetween(object1, object2)
--getNumCollisions(object)
--setScale(object, {x, y, z})
--changeAnimation(object, animationId)
--setAnimationSpeed(object, speed)

seen =             isCollisionTest(object)--true or false
see_object =        getObject(« objectName »)        
see_FOV =            0            
see_distance =        0
see_animation =        changeAnimation(object, animationId)        
-------------------------------[[SMELL]]---------------------------
smelled =             isCollisionTest(object)--true or false
smell_particle_system =
smell_animation =        changeAnimation(object, animationId)
-------------------------------[[HEAR]]---------------------------
--playSound(object)
--pauseSound(object)
--stopSound(object)
--getSoundGain(object)
--setSoundGain(object, gain)
heard =             false
hear_sound =        getSoundGain(object)
hear_proximity =        0
hear_pitch =        0
hear_animation =        changeAnimation(object, animationId) 
-------------------------------[[TOUCH]]---------------------------
touched =             isCollisionTest(object)
touch_object =         getObject("finish_line")
touch_animation =     changeAnimation(object, animationId)

-------------------------------[[TASTE]]---------------------------
tasted =             isCollisionTest(object)
taste_object =        getObject(« objectName »)
taste_proximity =        0

--------------------------------------------------------------------------------------------

--FUNCTIONS--

--------[[MOVEMENT]]------
--translate(object,direction,"local")
--clearForces(object)
--addCentralForce(object, {x, y, z}, "local")
--addTorque(object, {x, y, z}, "local")

function Move(move_direction,move_speed,move_btn,move_animation)
    if isKeyPressed(move_btn) then
        changeAnimation(object,move_animation)
        translate(object,move_direction,"local")
    end    
end

--local forward = move_forward
--local backward=move_backward
--local left=move_left
--local right=move_right
--local up=move_up
--local down=move_down
------------------------------------------------------------------------
function Jump(jump_direction,jump_height,jump_speed,jump_btn,jump_animation)
    if isKeyPressed(jump_btn) then
        changeAnimation(object,0)
        addCentralForce(object, {x, jump_height, z}, "local")
    end
end
------------------------------------------------------------------------
function Spin(spin_direction,spin_speed,spin_btn,spin_animation)
    if isKeyPressed(key) then
        changeAnimation(object,0)
        rotate(object,spin_direction,angle,"local")
    end
end
------------------------------------------------------------------------
function Physics()
    
    
end
------------------------------------------------------------------------

----[[SENSES]]-----

function See()
    if seen then
        changeAnimation(object,0)
    end

end
------------------------------------------------------------------------
function Hear()
    if heard then
        changeAnimation(object,0)
    end
end
------------------------------------------------------------------------
function Touch()
    if touched then
        changeAnimation(object,0)
    end
end
------------------------------------------------------------------------
function Taste()
    if tasted then
        changeAnimation(object,0)
        tasted=true
    end
end
------------------------------------------------------------------------
function Smell()
    if smelled then
        changeAnimation(object,0)
        smelled=true
    end
end
------------------------------------------------------------------------

--------------------------------------------------------------------------------

--SAMPLE GAME:--

--setText(object , "text")
--getText(object)
--getTextColor(object)
--setTextColor(object, {r, g, b, a})
--getScene("sceneName")
--changeScene(scene)
--getCurrentSceneId()
--getScenesNumber()
--loadLevel("levels/myLevel.level")


menu = Menu() --Creates a new menu
menu.Start() --Starts the menu
menu.End() --Stops the menu
--------------------------------------------------------------------------------------------
--changeCurrentCamera(object)
--getCurrentCamera()
--getCameraClearColor(object)
--getCameraFov(object)
--getCameraNear(object)
--getCameraFar(object)
--getCameraFogDistance(object)
--isCameraOrtho(object)
--isCameraFogEnabled(object)
--setCameraClearColor(object, {r, g, b})
--setCameraFov(object, fov)
--setCameraNear(object, near)
--setCameraFar(object, far)
--setCameraFogDistance(object, fogDistance)
--enableCameraOrtho(object, ortho)
--enableCameraFog(object, fog)
--enableCameraLayer(object, scene)
--disableCameraLayer(object)
--enableRenderToTexture(object, "textureName", renderWith, renderHeight)
--disableRenderToTexture(object)
--***getProjectedPoint(object, point)
--***getUnProjectedPoint(object, point)

--getScene("sceneName")
--getScenesNumber()

cut_scene = newCutScene() --Creates a new cut-scene
cut_scene.Play()         --Plays the new cut-scene
cut_scene.Stop() --Stops the new cut-secene

--getScene("sceneName")
--getScenesNumber()

cut_scene_2 = newCutScene() --Creates a new cut-scene
cut_scene_2.Play()    changeScene(scene) --Plays the new cut-scene
cut_scene_2.Stop() --Stops the new cut-secene
-------------------------------------------------------------------------------------
--loadLevel("levels/myLevel.level")

level1 = Level() --Creates a new level
level1.Begin() =         loadLevel("levelName") --Starts the new level
level1.Finish() --Stops the new level
-------------------------------------------------------------------------------------
--getObject(« objectName »)
--activate(object)
--deactivate(object)
--isVisible(object)
--isActive(object)

prop1 = Prop()=    --Creates a new prop
prop1.Create(room) --Creates the mesh for the new prop
prop1.Destroy()
-------------------------------------------------------------------------------------
man1 = Person()--Creates a new person called man1
man1.Create(man)    activate(object) --Creates the mesh for the new man (can be woman also)
man1.Move    (move_direction,move_speed,move_button,move_animation) --Move() forward at 5mph using the UP button and playing the WALK animation
man1.Jump(jump_height,jump_speed,jump_animation) --Makes the man able to jump
man1.Spin(spin_direction,spin_speed,spin_btn) --Makes the man able to move spin
man1.Physical() --Makes the man physical
-------------------------------------------------------------------------------------
man1.See() --Makes the man able to see
man1.Hear() --Makes the man able to hear
man1.Touch() --Makes the man able to touch
man1.Taste() --Makes the man able to taste
man1.Smell() --Makes the man able to smell
-------------------------------------------------------------------------------------


--OTHER--
--[[dofile("lights/lightsfx.lua") 
   light = getObject("Light") 
   function onSceneUpdate()
       flickerLightEffects(light)
   end]]
   
   --function QuitGame()
--if isKeyPressed("Q") then
    --quit()
--end
--end

575

(20 replies, posted in Scripting)

Argoon wrote:

Hi Tutorial Doctor yes the charRun() is being called under the onSceneUpdate() function, this is maybe a logic problem, perhaps theres a better way for making the run function, i tried a "while exp do block end" but maratis crashed (maybe it was a infinite loop).

Haha! Every time I use a while loop Maratis crashes! haha yeah, I think I get an infinite loop.

I am actually working on a game script template. Was just getting ready to post my second phase on the forum.