76

(6 replies, posted in Scripting)

I actually did this in my artificial intelligence level accidentally. I parented a cone to the object and made the cone a ghost object with physics.

Now you can check collisions with the cone, and add a central force to the object when something collides with e cone.

If the cone is rotated towards the ground, and it is long enough, then it will act as a ground detection device, and the object will get a jolt every time the cone touches the ground.

77

(4 replies, posted in Scripting)

I only have one constant for the Maratis Editor so far, and I am looking to add more.

CENTER = vec3(0,0,0)

Got some more:

ON = true
OFF = false
RUNNING = true

78

(44 replies, posted in Scripting)

I need to make a simple Say() function that sets a text to a string.

Say("Hello Maratis")

I could also make this an audio thing so that I could possibly type:

if happy then
    Say(hello)
end

However, in the event that the Say() function is choosing an audio file to play based on an emotion I could type:

Say(hello)

And the character can choose from three different ways to say hello given an feeling:

if happy then 
   hello = getObject("HelloHappy")
elseif sad then
   hello = getObject("HelloSad")
elseif normal then
   hello = getObject("HelloNorm")
end

79

(6 replies, posted in General)

Hmm, so will there be the ability to edit a .mesh file from the LUA side in  future release where I could adjust the diffuse color of a material from withn the code? I am guessing this could happen with a plugin to the editor I guess? I am really thinking of digging into the C++ side of Maratis, but I just want to see if I can get something done on the LUA side, since that is the side most new users might prefert to use, and then the might go to the C++ side for more control, or to add their own custom features.

80

(3 replies, posted in Gossip)

Hi Alien! Hehe. Welcome.

Hopefully soon I will have some demo games that newcomers can play around with to see how Maratis works. It's a cool engine.

81

(14 replies, posted in Tutorials/Examples)

The screenshots above are looking a lot more doable now that I have a UV unwrapping technique and export workflow in Blender established. The lighting shouldn't be that hard either.

82

(2 replies, posted in General)

Chances are I am going to be doing a lot of baking lights and shadows for now, and just using perhaps one light to cast shadows (although even then those shadows don't look so good) or making a script that projects a simple oval underneath objects as a shadow (like they used to do in old games).

The way I have organized the files in the Starter pack lends to easily putting lots of different meshes in the game, and you can just copy and paste the meshs folder if you want to upload, since each sub-folder has its own maps and meshs folders, and the meshs reference their own maps folder.

That example you give is the type of game I will be going for when I finish the AI system:
http://forum.maratis3d.com/viewtopic.php?id=763

I just need to do some better animation and make a more involved level (more polish as you say).

I have been looking at tutorials on how to do this quickly, so once I start, I will upload those levels for use or for testing.

Thanks for the tip. Any more tips would help.

So, the Starter Pack I have started is close to good enough where I can make a demo Game with it:
http://forum.maratis3d.com/viewtopic.php?id=986

Adding functionality to my games has become a lot easier with this starter pack. I still need to organize things a bit, but now I want to create a demo game.

You have probably seen the upload I made with Jules in it called Jules N' funland:
http://forum.maratis3d.com/viewtopic.php?id=775

I kinda like that style of game. It's sorta like Yo Frankie.

Or perhaps I can make 3 levels for 3 different genres?

I could do a first person, a third person adventure, and a third person RPG style?

Of course, the first person will use the Sponza Level controls for now (re-organized by me to make it easier to use). Perhaps I will just use the Jules Level for the third person adventure (re-organized by me to make it easier to use). And I could perhaps use the same third person adventure script to do the RPG thing too.

Can anyone recommend any games that seem doable in Maratis in the aforementioned genres?

84

(22 replies, posted in General)

Vegas has a script and project for orthographic(2d) style games:

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

85

(2 replies, posted in Showcase)

Type: Script
Name: Particle System
What it does

This script allows you to emit an object as a particle from another object.

Instructions

1) put the "Effects.lua" file in the main "scripts" folder.
2) in the "System.lua" file add the line: dofile("Effects.lua")
3) In the main.lua script, outside of the update function make your particle like this:

makeParticle(object1,object2)

The first object is the object that will be the particle, and the 2nd object is the object that will emit the first object.
4) In the main.lua script under the update function call the function:

Particles()
Notes:

-The particle being emitted has to have physics enabled and a mass of at least 1.
-All objects should be created in the objects.lua script (if you want to edit and re-upload).

Download(1kb):

https://sites.google.com/site/maratisfi … ffects.zip
https://sites.google.com/site/maratisfiles/files/Screenshot%20%28960%29.png

Credits:

Thank you anael for this amazing script! I have to work out some bugs a little though to make it work better.

86

(2 replies, posted in Showcase)

Introduction

This is a Maratis Starter Pack I am working on. It is very primitive right now, but I wanted to go ahead and share what I have so far.

The intent of this pack is to provide new users of Maratis with a full working example of the Maratis API in action, as well as provide starter assets for making a game. I want this to be a collaborative deal, so please add to the pack.

I will be working on the graphics once I get a few scripts and objects done.

What is included

This pack comes pre-loaded with a few small maps, meshs, sounds, fonts, and scripts to get you started.

I tried to keep the naming in my scripts simple and clear. I also tried to keep the functions short and easy to understand, so take a look at the scripts to see how they work.

How it is set up

The "main.lua" file is where all of the functions are used (some are commented out). The "system.lua" file is where all new scripts should be referenced (the "main.lua" file references the "system.lua" file. All objects are created in the "objects.lua" file etc.

How to add to the pack

If you want to upload meshes, create a folder for your meshes (with an appropriate name), and inside of the folder store the "maps" and "meshs" folders for your upload. All of your meshes should reference YOUR meshs folder, and not the main meshs folder. Store the top level folder in the main meshs folder.

If you want to upload a script, and it references objects, be sure to create those objects in the "objects.lua" file. Also, provide the objects with the method above. You will also have to include the .level file. The .level file should have a unique title to your upload. If you don't want to upload the objects, provide instruction on how the objects should be created, and where they should be located.

If you want to upload sounds, create a folder and store all of sounds in it.

Please upload all files as .zip files preferably, but RAR files are okay too.

The best way to upload files is via dropbox.com or box.com as hosting sites tend to become bad links. I also use googlesites for small files.

Notes:


-You can change the typing sound if you want, or disable it by commenting out the "playSound()" function in the TextInput script next to the key want to disable it for.
--If you change the angular factor of the box to 0 it will stay oriented in the up position.

Credits:

Thanks to Vegas, Zester, and Anael for all of your help and input.
Special thanks to Vegas, and your awesome scripts!
-Tutorial Doctor

Well here is the download so far

Download(250mb):
https://app.box.com/s/x4eoi09s6jx781gguzxa
https://sites.google.com/site/maratisfiles/files/Screenshot%20%28959%29.png

Updates:

Particles
--I am working on adding the particle system described here:
http://forum.maratis3d.com/viewtopic.php?id=550
--Particle system is finished (though rough). Check my 2nd post for instructions (I will update the main download once I have made a bit more functionality.
-- If you have any ideas on what I should do to it please post them here:
http://forum.maratis3d.com/viewtopic.php?id=954

--Working out my texturing and modeling process:
https://sites.google.com/site/maratisfiles/files/Screenshot%20%28967%29.png

Sounds
--Just added a few music folder in the sounds folder and added a few songs.

87

(2 replies, posted in Tutorials/Examples)

Interesting software, just from using it for a few seconds, I can tell it might be useful. That level looks like a good start also.

I think it is already possible to extend the engine with game plugins as was done here:

http://www.maratis3d.org/?p=563

And welcome!

88

(5 replies, posted in Gossip)

Okay, got it. I added it to my reading list. It didn't come up on flipboard.

89

(5 replies, posted in Gossip)

I'm interested, but I don't I would have to create a twitter account.

90

(2 replies, posted in Scripting)

Thank you anael! I will see if this does what I need it to.

Edit: I can't get it to work. I did:

pos = getUnprojectedPoint(mainCamera,vec3(.5,.5,1))

Then:

setPosition(monkey,pos)

thinking that this should put the monkey at the center of the camera. Am I doing it right?

91

(2 replies, posted in Scripting)

I used the getWindowSale() function to do this:

windowSize = getWindowScale()
WIDTH = windowSize[1]
HEIGHT = windowSize[2]

CENTER = {WIDTH/2,HEIGHT/2}

Anyone know how I would place an object relative to a camera, at the center of the screen, or at any point?

Does getWindowScale() have anything to do with the camera? Or should I be using camera functions?

What purpose could getWindowSale() serve?

92

(3 replies, posted in Scripting)

Automatically type text

: Thanks to Vegas for this one. I just modified it a bit to make it easier to understand.

--time variable
t = 0

--initialize counter variable
count = 0


function TypeText(typedText,delay,usedText)
    setText(usedText, T1text)
    
    --increment timer
    t = t + 1
    
    -- Change 5 to a different value to increase or decrease typing speed. Lower is faster. 5 is the default.
    if t == delay then
        count = count + 1
        t = 0
    end
    
    -- it's that string.sub thing who's writing letter one by one
    for i=1, count do T1text = string.sub (typedText, 1, 0+i) end
    
    -- Stop counting when we are at the end of the line
    if count == string.len(typedText) then t = 0 end
end
Explanation
function TypeText(typedText,delay,usedText)

The typedText parameter should be a variable with a string data type. The speed is actually the "delay", so lower numbers are faster. The usedText parameter is the text object you want to use.

93

(3 replies, posted in Scripting)

Toggle a Light on and off using a specified key
lightState = true

function ToggleLight(object,key)
    if lightState==false and onKeyDown(key)then
        setLightIntensity(object,1)
        lightState = true
        
    elseif lightState==true and onKeyDown(key)then
        setLightIntensity(object,0)
        lightState = false
    end
end

They "key" parameter must be in double quotes and can use any of the KEY LITERALS here:
http://wiki.maratis3d.org/index.php?title=Lua_scripting

94

(3 replies, posted in Scripting)

Click an object from the view of a Camera:
clicked = false

function Click(objectName,camera)
    --[[----------------------------------------------------------------------UNPROJECTED POINT]]
    mx = getAxis("MOUSE_X")
    my = getAxis("MOUSE_Y")    

    V1 = getUnProjectedPoint(camera, vec3(mx, my, 0))
    V2 = getUnProjectedPoint(camera, vec3(mx, my, 1))
    
    point = rayHit(V1,V2,objectName)  -- note that rayHit only detects objects with physics enabled
    
    if point then 
        Xname = getName(objectName)
        Xobj = getObject(Xname)
        --setText(text,Xname)
        --print(Xname)
        
        if Xname == getName(objectName) and onKeyDown("MOUSE_BUTTON1") then 
            deactivate(Xobj)            
            playSound(sound) 
            clicked = true 
        else 
            clicked = false 
        end
    end
end    

The parameters it takes is the object you want to click, and the camera from which you want to click the object.

95

(5 replies, posted in Scripting)

I think I was mistaken. It seems a path finding algorithm would find the "shortest path" from one location to another. This is not what I was looking for, but just a way to get an object to follow a path. Of course, now this makes me want to work on the path finding thing. Although I might just use my senses system for navigation.

96

(5 replies, posted in Scripting)

I think this parametric equation will work:

http://lima.osu.edu/people/iboyadzhiev/ … etric.html

97

(5 replies, posted in Scripting)

Here are are some functions I made that make an object follow a few types of curves, like sine curves, artangent curves, and even a circle as a parametric curve.

I think I would have to do some type of parametric curve fitting.

--Outside the onSceneUpdate() function
u=0
ground = 2
center = vec3{0,0,ground}
x = u 
y = 0
drag = 5

--These functions called inside the onSceneUpdate() function

function Sinuside(object)
    u = u + 1
        
    x = u/drag 
    y = 9*math.sin(x)
        
    path = vec3(x,y,ground)

    setPosition(object,path)
end

function Cosinide(object)
    u = u + 1
        
    x = u/drag 
    y = 9*math.cos(x)
        
    path = vec3(x,y,ground)

    setPosition(object,path)
end

function Arctangic(object)
    u = u + 1
        
    x = u/drag 
    y = 9*math.atan(x)
        
    path = vec3(x,y,ground)

    setPosition(object,path)
end

function ArcSinusidal(object)
    u = u + 1
        
    x = u/drag 
    y = math.asin(x/60)
        
    path = vec3(x,y,ground)

    setPosition(object,path)
end

--x = r cos(t)    y = r sin(t)


function Circulate(object,radius,speed)
    u = u + speed
        
    x = speed * radius * math.cos(u)
    y = speed * radius * math.sin(u)
        
    path = vec3(x,y,ground)

    setPosition(object,path)
end

function Elipticate(object,width,height)
    u = u + .1
        
    x = width * math.cos(u)
    y = height * math.sin(u)
        
    path = vec3(x,y,ground)

    setPosition(object,path)
end

98

(5 replies, posted in Scripting)

Perhaps this will help me:
http://www.cs.bham.ac.uk/~slb/courses/Graphics/g88.html

We will see

Or this:

http://www.geometrictools.com/Documenta … dSpeed.pdf

99

(14 replies, posted in Tutorials/Examples)

I am getting closer to being able to make the 3rd person game:

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

100

(1 replies, posted in Scripting)

I figured out how to change the code for it to work!

Unprojected = getObject("Unprojected")
clicked = false

function Click(objectName,camera)
    --[[----------------------------------------------------------------------UNPROJECTED POINT]]
    mx = getAxis("MOUSE_X")
    my = getAxis("MOUSE_Y")    

    V1 = getUnProjectedPoint(camera, vec3(mx, my, 0))
    V2 = getUnProjectedPoint(camera, vec3(mx, my, 1))

    --point, Unprojected = rayHit(V1, V2) -- note that rayHit only detects objects with physics enabled
    
    point = rayHit(V1,V2,objectName)
    
    
    if point then --if there is a collision between camera and a point (x,y,z) where x is mouse position, and y is mouse position and z is extended in front...
        Xname = getName(objectName)
        Xobj = getObject(Xname)
        --setText(text,Xname)
        --print(Xname)
        
        if Xname == getName(objectName) and onKeyDown("MOUSE_BUTTON1") then 
            --deactivate(Xobj)
            deactivate(Xobj)            
            playSound(sound) 
            clicked = true 
        --[[else 
            clicked = false --]]
        end
    end
        
end