101

(1 replies, posted in Scripting)

I can't figure out why this code isn't working. The object does have physics enabled, and the "unprojected" object is in the game.

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, 4))

    point, Unprojected = rayHit(V1, V2) -- note that rayHit only detects objects with physics enabled
    
    
    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(Unprojected)
        Xobj = getObject(Xname)
        --setText(text,Xname)
        --print(Xname)
        
        if Xname == objectName and onKeyDown("MOUSE_BUTTON1") then 
            deactivate(Xobj) 
            playSound(sound) 
            clicked = true 
        --[[else 
            clicked = false --]]
        end
    end
        
end    

function onSceneUpdate()
    Click("monkey",mainCamera)
end

102

(2 replies, posted in General)

Here are some tips on exporting from blender.

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

One thing it could be is that the texture maps aren't applied correctly. You could check the .mesh files for the objects.

You do have lights in the project right?

103

(3 replies, posted in General)

How do I install the plugin in notepad++? I mean, how do I get it to recognize the API?

104

(11 replies, posted in Gossip)

As far as I know tetris wasn't based on a violent game. Strategy or puzzle games tend to not be violent.

The style of game I want to make is The Last of Us though, a sort of story game, but my animation skills are not good enough. I could do it Max Payne style with storyboard paintings, but I really don't have enough sound resources either, nor concept art skills.

105

(3 replies, posted in General)

This is going to be so useful. I would love to use Notepad++
I am going to download this when I get home.

106

(5 replies, posted in Scripting)

This might be a bug or something. This happened with another lua file, but when I moved it to the same folder as the main lua file, it worked.

107

(1 replies, posted in General)

I started with the tutorials from this guy:

http://youtu.be/wHu7PYuP7Eg

108

(44 replies, posted in Scripting)

Just uploaded a very quick and dirty version of the senses system in 3rd person.

109

(44 replies, posted in Scripting)

Okay, after a very good conversation on gamedev.net
http://www.gamedev.net/topic/655272-i-h … ew-habits/

I think I will be applying fuzzy logic instead of boolean logic to make the Senses system more realistic. For the main 5 senses I will use boolean logic. But to make this more of an AI system, I will use fuzzy logic.

110

(44 replies, posted in Scripting)

Okay, here are a list of things that I can use the current Senses system for:

Automatic Navigation -- If an object is seen, the walking character can turn left or turn right. They can jump or duck. I can make invisible primitive planes that, if seen, can make the character turn a certain direction, or perform any other type of action. The same goes for touch. I can't get hearing working yet, and smell requires a particle system (there is one, but it still crashes on me.)

Enemy AI -- if an an enemy sees you, they can attack you.

Trigger Emotions-- The senses can trigger a change in state. Perhaps the character is happy and a happy animation plays, but when it sees a dog, it gets afraid, and the character does a 180' and runs?

I will try to put together a little demo that demonstrates several of these scenarios.

111

(5 replies, posted in Scripting)

Yes, it is like Example 1.

112

(5 replies, posted in Scripting)

It's not that. I changed that already

113

(5 replies, posted in Scripting)

I am trying to call a function from a lua script located dofile("other/Motion.lua")

When I try to run the Move() function (located in the Motion.lua file) I get an error:

[string "dofile<"other/Motion.lua">...]:17 attempt to call global 'Move' <a nil value>

What could be causing this? all of the arguments are in the Motion.lua file.

The function in the Motion.lua file:

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")
        playSound(move_sound)
        setAnimationSpeed(move_object, move_animation_speed)
        
    end    
    
    if onKeyDown(move_btn) 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

How I use it in the main file:

box = getObject("Box") -- in the main scene
function onSceneUpdate()
Move(box,move_forward,move_btn_U)
    Move(box,move_backward,move_btn_D)
    Move(box,move_left,move_btn_L)
    Move(box,move_right,move_btn_R)
    
    --Jump Box
    Jump(box,jump_up,jump_btn)
    
    --Spin Box
    Spin(box,spin_left,spin_btn_L)
    Spin(box,spin_right,spin_btn_R)
end

114

(0 replies, posted in General)

Okay, so I am trying to package a Maratis Starter pack, which includes scripts and objects from various projects. However, I don't just want to drop all meshes in the meshes folder, and all maps in the maps folder etc. I wanted it to be a bit more organized.

However again, when I create a new directory, I have to edit the mesh files to point to the correct folders, and all corresponding maps.

I am wondering if the .level files of the projects are all I need to separate the various scenes (as long as the meshes and maps and scripts are in their correct place.)

115

(22 replies, posted in General)

I am going to put additional scripts in a main script file using dofile, and somehow get them to all work in one project. I might just create several levels for one project. We will see.

Edit: Scratch that, it would take too long to move all the dependencies into the right place.

Edit: Okay, I have all the scripts set up, now I am going to start making tiny little useful functions. I added scripts for each Function category (lights.lua camera.lua etc). I also copied and pasted in all of the API functions into the scripts so you don't have to keep referencing the wiki.

If I can get dofile() to jump up a directory correctly, I can organize them better.

116

(19 replies, posted in Engine)

I did some camera layer stuff just now I do it this way:

cam_main = getObject("Cam_Main")

gui = getScene("GUI")

enableCameraLayer(cam_main,gui)

This way I can change the camera explicitly, or overlay the stuff on other cameras:

enableCameraLayer(cam_ortho,gui)

117

(3 replies, posted in Showcase)

Your project file has the wrong extension somehow. It is .MPORJ instead of .MPROJ.
After changing it, I was able to get the project to open.

Good job on the maze however!

I changed the "Q" and "E" for turning to "LEFT" and "RIGHT", it feels a bit better.

Oh, and I will not be erasing this game, because it at least works, and I can learn some stuff from it.

118

(10 replies, posted in Scripting)

If you are trying to add a force to the cube, the code should be:

addCentralForce(Cube,{8,0,0},"local")

Also, it is best to name objects in the Editor also:

cube = getObject("Cube")

Then your code would be:

addCentralForce(cube,{8,0,0},"local")

And you would be adding a force to the "cube" variable, which is getting the object named "Cube" in the editor.

119

(22 replies, posted in General)

I want to include particles also. Here is a link to the system I will include:

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

120

(10 replies, posted in Scripting)

By the way, I wish I knew C++ better. I would love to add features to the engine itself (which you could do, since you know C++), and you can make game plugins and such. When I get a chance I will finish learning C++.

121

(10 replies, posted in Scripting)

I am comming from another angle myself. I can't stand the syntax of C++, but after thorough investigation into learning C++, I see the power of it, and why it was designed the way it was.

I like Python and Lua also, and I am really liking the flexibility of LUA. I liike the syntax of LUA more than Python because with Python you have to indent correctly or else you will get errors. Not the case with lua. A statement is ended with the word "end."

I have a few tutorials on here about about programming in LUA.

122

(44 replies, posted in Scripting)

Can't get this distance thing to work right. The ears are parented to the player, which is moving. At the start of the program, the distance reads 33. It only changes when I move the monkey, not when I get closer to the monkey. It seems the distance is being calculated between the monkey and some point in the middle of the level. I checked to see if the origin of the ears is off, but it isn't.

Here is the code for calculating the distance:

function Hear(object)
    earPosition = getPosition(ears)
    heardObjectPosition = getPosition(object)
    
    x2= heardObjectPosition[1]
    x1= earPosition[1]
    y2= heardObjectPosition[2]
    y1= earPosition[2]
    z2= heardObjectPosition[3]
    z1= earPosition[3]
    
    xDiff = x2-x1
    yDiff = y2-y1
    zDiff = z2-z1
    
    radicand =  math.pow(xDiff,2) + math.pow(yDiff,2) + math.pow(zDiff,2)
    distance = math.sqrt(radicand)
    
    if distance > 20 and distance < 30 then
        setText(hear,"I hear something...")
    else
        setText(hear,"I hear nothing")
    end
    
    setText(hear_distance,"Distance:"..distance)
end

123

(22 replies, posted in General)

Anyone have any ideas of standard phrases that I can generate with this text to speech app? So far I have:

Animating...
Walking...
Running..
Idling...
Jumping...

Falling...
I see something...
I hear something...
I feel something...
I smell something...
I taste something...

Game Over...
I am indoors.
I am outdoors.

Who turned on the lights?
Who turned off the lights?

Can't go this way!
Moving forward.
Moving backward.
Turning right.
Turning left.


I don't think these phrases can be applied in a variety of cases. Just wondering if anyone has any ideas.

Perhaps I can use the voices for debugging purposes. For instance, I can play a voice when a collision happens, or when the character starts an animation. If the character is walking, I will play a voice that says "walking."

I use the voices in a similar way in my senses system level.

124

(0 replies, posted in Scripting)

My favorite software for making 2d games is Gamepress:
http://www.gamepressapp.com/

I just realized that that app has just about all of the features one would need to make any game of their choice, but it is in 2D.
So, I am going to try to emulate as many of the functions this app has in Maratis (I am going to start with the easiest and most useful). Here is a list of the functions I am going to work on:



CONTROLS:

joystickControlled(object,configuration)
jumpWithButton(button,animation)
dragAndDrop(object)

LEVEL:

gameOver()
loadLevel(level)
loadNextLevel()
restartLevel()
pause()

SOUND:

playMusic(sound)
stopMusic(sound)

MOTION:

moveToward(object)
moveAlongPath(path)
moveToPoint(point)

UI:

addToHealthBar(amount)
setHealthBar(value)
addToScore(text)
changeText(text)
addToLifeIndicator(indicator)
textInput()

SCREEN:

rotateScreen(angle)
shakeScreen(force)
wrapAroundScreen(object)
screenToObject(object)
screenToPoint(point)

FX:

playAnimation(animation)
stopAnimation(animation)
playSound(sound)
stopAllSoundEffects()
startParticles(particleSystem)

PHYSICS:

applyForce(object,direction)
propelObject(object,direction,speed)
setGravity(gravity)
makePhysical()
makeWall()
makeScenery()

LOGIC:

CUSTOM:

More to come...

125

(22 replies, posted in General)

Okay. Will do. I am going to clean it up and organize it first though. I remembered I had a Box.com account that gave me like 50GB or 500GB (can't remember) so I could upload all files. But to keep it light, I will pick and choose. I will also organize the scripts and comment them (so that they are legible).

I am going to make a different character first though (doesn't take long, because I am using quidam studio). I also animate my characters with A custom Blender download:

http://blenderartists.org/forum/showthr … Kinematics

I will upload the blend files also.