Jump to content

Soamp

Members
  • Posts

    128
  • Joined

  • Last visited

Posts posted by Soamp

  1. Hi.

    I need to have 2 separate cameras and display each camera in a separate "monitor".

     

    I could make 2 cameras in Lua and rendered them picture in picture. and now I want to display second camera in another monitor (or maybe more cameras and monitors)

    is this possible with Lua or I have to use C++?

  2. @Roland : Thanks for your attention . I know that. But our scripts are too long and too much.

    @Josh: Thanks encrypting is good choice. But luac is not secure encrypting and my base code in lua, and our lua codes are import for me.

    Do you know better solution for it?

  3. and here is additional information :D

    post-580-0-29782400-1307718779_thumb.jpg

    Language: C++

    IDE: VisualStudio 2010

     

    in fact we need to know if engine searchs for lua files inside zipped packes?

     

    #include "engine.h"
    #include <iostream>
    #include <string>
    
    const int 	ScreenWidth = 800;
    const int 	ScreenHeight = 600;
    const char* MediaDir =  ".";
    const char* AppTitle = "DSGAME";
    
    void ErrOut( const std::string& message ) { std::cerr << message << std::endl; }
    
    //	-------------------------------
    int main( int argn, char* argv[] )
    {
    if( !Initialize() )
    	return 1;        
    
    if( !Graphics(ScreenWidth,ScreenHeight) )
    {                
    	ErrOut( "Failed to set graphics mode."  );
    	return 1;        
    }
    SetAppTitle( AppTitle ) ;
    RegisterAbstractPath( MediaDir );
    SetZipStreamPassword("Menu.pak","123");
    SetZipStreamPassword("Scripts.pak","123");
    TFramework fw = CreateFramework();        
    if( fw == NULL )        
    {
    	ErrOut( "Failed to initialize engine." );                
    	return 1;        
    }        
    
    SetGlobalObject( "fw", fw );                
    
    BP lua = GetLuaState();        
    lua_pushobject( lua, fw );        
    lua_setglobal( lua, "fw" );        
    lua_pop( lua, 1 );        
    
    while(	GetGlobalNumber("Game") == 1 && !AppTerminate())        
    {
    	if( !AppSuspended() )
    	{
    		UpdateFramework();                
    		RenderFramework();
    		Flip( 0 );        
    	}
    }
    return Terminate();
    }
    

  4. Is there any difference between packing models/texture folder with packing Script folder?

    when I try to pack script folder, it will cause a "Can't Open" error.

    while when I pack models/textures folders there is nothing wrong. :-??

  5. Thank you Guys

    I ask this because some times my Characters do hide and i think this problem is somehow related to these bounding boxes

     

     

    I turned my occlusion culling off ,but still i have same problem !

     

    Help Please :)

  6. first question:

    I see two kind of boxes around my models in Leadwerks Editor.

    the blue boxes which I guess they are bounding boxes, and the yellow one which I have no ideas what are they.

     

    post-580-0-38051600-1304503200_thumb.jpg

     

    second question:

    if I add a skinned model into a scene, the yellow box will be draw from 0,0,0 to my most far point of skinned model.

    first hand is simple mesh and second one is skinned model. and you can see boxes there.

     

    post-580-0-18868900-1304503480_thumb.jpg

     

    any related information about these boxes and their usage would be helpful.

  7. thank you all for your kind words.

     

    @paramecij: thanks. we are a team. doing all those by one person should be terrible!

     

    @Josh: :)

     

    @Red Ocktober: Don't look at the bullets there! it's still WIP!

     

    @Pixel Perfect: Thanks, sure we will show more in-game.

     

    @Ywa:Thank you. first we decided to make a gameplay video and a separate technical video. but we could not capture enough videos on time!

     

    @Rick, gamecreator, macklebee: Thank you all..

  8. As far as I can tell, this example uses messages..

     

    Hi, you can use something like this

    require("scripts/utilities")
    ...
    local pick=CameraPick(fw.main.camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,2.0),0,0)
    if pick then
        local pickedmodel=GetMeshModel(pick.entity)
        objecttable[pickedmodel]:open()
    end
    

  9. Hi, I post this on "Bug Tracker" before but I didn't get any kind of response in last 2 weeks so I'm gonna post it here too. would you guys take a look at this. thanks in advance:

     

    We have a problem with animating our character. The description is quite long, I apologize in advance.

    We use LUA. We have a GMF file which is the T-Stand of our character. This file contains the character's mesh.

    We also have several GMF files, they don't have any mesh. They only consist of our character's motion. Let me give you a for instance :

    We have a file named "Characters_Jasem.gmf" which is attached. It contains the mesh.

    And a file named "Motion_Bot_Ak47_run.gmf" which is attached too and only contains the hierarchy and the "Run" motion.

     

    We load our character's mesh like this :

    	charmesh=LoadMesh("abstract::Characters_Jasem.gmf")

     

     

    then We use LoadAnimation command like this :

    	animseq=LoadAnimation(charmesh,"abstract::Motion_Bot_Ak47_run.gmf")

     

    LoadAnimation returns sequence number of the loaded animation.

     

    then we use this to animate the character :

    	Animate(charmesh, object.frame,object.blend,animseq, true)

     

    We calculate frame and blend like this :

    	object.frame = object.frame+(AppTime()-object.lastframetime)/25
    object.frame = math.fmod(object.frame, object.frameend-object.framestart)
    object.lastframetime=AppTime()
    
    object.blend=Curve(1,object.blend,40)

     

    Everything is OK in general, this works fine on nVidia graphic cards. But on ATI cards, the character's leg get disapear suddenly.

     

    Same leg, from the exact same bone, everytime!

     

    I attached two pics which show the problem. We check this on several ATI card , all of them have the exact same problem.

    Correct character :

    post-580-042880500 1288774439_thumb.jpg

     

    Character with hidden leg :

    post-580-019904300 1288774453_thumb.jpg

     

    We have been working on it for a long time til we just found the problem goes away when we use Animate command like this :

    	Animate(charmesh, object.frame,1,animseq, true)

     

    We replaced "object.blend" with "1" (we dont use motion blending) and everythig is OK, on both nVidia and ATI cards.

     

    But our motions changes very suddenly and it looks terrible! Would you take a look at this?

     

    thanks.

    GMF Files.rar

  10. Hi,

    I'm trying to do the same thing in LUA. abstraction of my code is something like this :

     

    I create a new world and camera :

    FSRfw={}
    FSRfw.top={}
    
    local wrld=CurrentWorld()
    FSRfw.top.world=CreateWorld()
    SetWorld(FSRfw.top.world)
    FSRfw.top.camera=CreateCamera()
    CameraClearColor(FSRfw.top.camera,Vec4(0,0,0,1))
    CameraClearMode(FSRfw.top.camera,BUFFER_DEPTH)
    SetWorld(wrld)

     

    loading a model in new world :

        SetWorld(FSRfw.top.world)
       object.test=LoadModel("abstract::Environment_CharityBox.gmf",model)
       SetWorld(fw.main.world)
    

     

    and it's my rendering loop:

    while KeyHit(KEY_ESCAPE)==0 do    
       fw:Render()
    
       local wrl=CurrentWorld()
       SetWorld(FSRfw.top.world)
       SetEntityMatrix(FSRfw.top.camera,GetEntityMatrix(fw.main.camera))
       ClearBuffer(BUFFER_DEPTH)
       RenderWorld()
       SetWorld(wrl)
    
       fw:Update()
    
       wrl=CurrentWorld()
       SetWorld (FSRfw.top.world);
       UpdateWorld( AppSpeed() );
       SetWorld(wrl)
    
       Flip(0)
    end

     

    but it doesn't make any difference!

    it's funny! if I remove "RenderWorld()" line, my test-model renders anyway!

     

    what is wrong in my code?

  11. thanks guys,

    I thought about moving the model to transparency world, but I need to change the alpha value in code. Can I change the transparency of a model in real time with code when it's in transparency world?

     

    you know I need texture rotating for another reason too. I'm making a minimap on corner of screen (like any FPS game). I have a big texture as game map, I show player a part of map that the player is in. I use GUI panels with alpha value of 0.0 to show the part and value of 1.0 to hide rest of the map.

     

    In most FPS games, the map rotates when character rotates, I want to do it too. so I kinda need texture rotating for this reason too.

     

    does anyone have any idea how to do it?

  12. Hi,

    since we cant change the shape of controller from cylinder to an Ellipsoid cylinder, FPS weapon left outside the controller and penetrates into obstacles like attached pic.

     

    Does anyone know a good way to prevent FPS weapon from going into obstacles?

     

    I was thinking, if we can render hands and weapons in another place (or even another world) and then draw them on screen. but what can we do about lights , shadows , ...?

     

    thanks in advance.

    post-580-087299000 1285332380_thumb.jpg

  13. Hi,

    How can I draw a rotated image (texture)?

     

    I cant use a 3d model parented to the camera (like the compass model) because I need alpha blending.

    I'm trying to make a "shot angle indicator" that draws a blood arc on screen, shows the angle that FPS character has been shot from.

  14. Hi,

    How can I draw a rotated image (texture)?

     

    I cant use a 3d model parented to the camera (like the compass model) because I need alpha blending.

    I'm trying to make a "shot angle indicator" that draws a blood arc on screen, shows the angle that FPS character has been shot from.

  15. Hi,

    We have an FPS player and I create an emitter (fire particles) in front of the weapon when player is shooting.

    sometimes we get this weird error :

     

    stack traceback:

    [C]: in function 'Render'

    [string "AliFPS.lua"]:63: in main chunk

     

    where line 63 of alifps.lua is : fw.Render()

     

    when I comment the lines that create the emitter, everything is fine and we never get this error again! did anyone face this problem before?

     

    this is how I create the emitter :

     

    SetWorld(fw.transparency.world)
    object.shootemitter=CreateEmitter(5,100,Vec3(0,0,0),1)
    object.shootemitter:SetVelocity(Vec3(0,0,0))
    object.shootemitter:SetRadius(0.01,0.05)
    object.shootemitter:SetWaver(10)
    object.shootemitter:Paint(LoadMaterial("abstract::fire.mat"))
    object.shootemitter:SetPosition(object.shootpos,1)
    object.shootemitter:SetRotationSpeed(1)
    SetWorld(fw.main.world)
    

  16. Hi,

    I think the picked thing is mesh. I usually use 2 ways to access the model from its mesh. (in LUA actually bt I hope it helps)

     

    1 - when I create my model I access the mesh with this command :

     

    local mymesh=GetChild(mymodel,1)

     

    then I set its Target to my model, using SetTarget command. so I can access the model from the picked mesh, with GetTarget command.

     

    2 - There is a LUA function in "scripts\utilities.lua" called GetMeshModel. its a simple loop to get model from its mesh. I think you can use a similar code in any other language.

     

    I hope it helps.

×
×
  • Create New...