Jump to content

Search the Community

Showing results for tags 'Blitzmax'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Models
    • Animals
    • Barriers
    • Characters
    • Containers
    • Environments
    • Furniture
    • Props
    • Rocks
    • Vegetation
    • Vehicles
    • Weapons
  • Materials
    • Brick
    • Cartoon
    • Decals
    • Dirt
    • Grass
    • Industrial
    • Medieval
    • Metal
    • Plastic
    • Plaster
    • Rock
    • SciFi
    • Sky
    • Signs
    • Tile
    • Stone
    • Walls
    • Wood
  • Plugins
  • Scripts
    • GUI
    • Object
    • Utilities
  • Shaders
    • Post-Processing Effects
    • Surface
  • Sounds
    • Ambience
    • Effects
    • Music
  • Tools
  • BATTLE LEAGUE's Assets


There are no results to display.

There are no results to display.


  • Leadwerks
    • Technical Assistance
    • General Discussion
    • Programming
    • Game Art
    • Suggestion Box
    • Bug Reports
  • Platforms
    • Windows
    • Linux
    • OSX
  • Community
    • Showcase
    • Promotion
    • Off-topic
  • Arena Shooter's Forum
  • BATTLE LEAGUE's Topics
  • Away from Home's Zone Script
  • Away from Home's General
  • Away from Home's Zone Rigging / Modeling
  • Vec-Tec's Releases
  • Vec-Tec's Topics
  • Forth's Development
  • Forth's Game design
  • Forth's Graphics
  • Forth's Documentation
  • Forth's TODO
  • Forth's IMPORTANT
  • Forth's Screenshots
  • The uncertain world's Game Design
  • The uncertain world's Programming
  • The uncertain world's TODO
  • The uncertain world's Graphics
  • The uncertain world's Screenshots
  • Dark Age Mist's Videos

Product Groups

  • Leadwerks
  • Model Packs
  • Gear

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Found 30 results

  1. Hi. Just quick question if someone remembers anything about 2.5. I have problem that controller overlaps little bit 1x1x1 sized cube body, so it it kind of gets stuck on those bodies. I am using Sweptcollision(), but it's not helping at all. And there is lot of these bodies in my project. (over 3000) Controller creation: player=CreateController(1.8, 0.3, 0, 45, 1.3)
  2. I had a look over the Blitzmax templates from the LEBuilder and remake the tutorials. I was able now to load and render my map made with the Editor. Just wondering how could I access my objects from the map now. Also I am interested in adding some models. I tried this simple code right after my map was loaded and before entering in main loop: body:TBody = CreateBodyBox() SetBodyMass body, 1 For n = 1 To 100 body = TBody(CopyEntity(body)) PositionEntity body, Vec3(Rnd(-5, 5), n, Rnd(-5, 5)) Next but no cubes were visible..
  3. Hello, I have a problem using Blitzmax and Leadwerks with the build-mode "Threaded Build". Because the Blitzmax compiler can't compile in this mode if i'm importing leadwerks.engine. I tried to using threads in c# and it works fine with leadwerks, it seems like its an blitzmax issue. Is that an knowing issue which can't be solved or is there a possibility to solve this problem?
  4. Sometimes this code won't pick entity even though it's certainly picked. If GetEntityKey(mpick.entity, "player") then 'do stuff endif
  5. Arska134


    This isn't right way to do ragdolls i assume...? Global ppos:TVec3 ppos = EntityPosition(soldier) ' LEFT LEG LThighp:tbody=createbodysphere(.35) positionentity LThighp,entityposition(LThigh), 1 setbodymass LThighp,1.0 entitytype LThighp,1 entityparent LThigh,LThighp setbodymass LThighp,10 SetBodyElasticity LThighp,0 LCalfp:tbody=createbodysphere(.35) positionentity LCalfp,entityposition(LCalf),1 setbodymass LCalfp,1.0 entitytype LCalfp,1 entityparent LCalf,LCalfp setbodymass LCalfp,10 SetBodyElasticity LCalfp,0 Lfootp:tbody=createbodysphere(.35) positionentity LCalfp,entityposition(Lfoot),1 setbodymass Lfootp,1.0 entitytype Lfootp,1 entityparent Lfoot,Lfootp setbodymass Lfootp,10 SetBodyElasticity Lfootp,0 LThighCalfJoint:tjoint=createjointball(LThighp,LCalfp,vec3(ppos.x+0,ppos.y+3+1.25,ppos.z+-.01)) LCalfFootJoint:tjoint=createjointball(LCalfp,LFootp,vec3(ppos.x+0,ppos.y+3+1.25,ppos.z+-.01)) Is there any examples about ragdolls?
  6. Arska134

    Find bones

    Alright, so i am now trying to find bones from soldier.gmf entity, but i am getting pretty strange results. This code: soldier = loadmesh("abstract::soldier.gmf") positionentity(soldier, vec3(-6, 2, 63)) Print "X "+entityposition(FindChild( soldier, "Bip01" )).X Print "Y "+entityposition(FindChild( soldier, "Bip01" )).Y Print "Z "+entityposition(FindChild( soldier, "Bip01" )).Z Is outputting this: X 0.000000000 Y 0.992219925 Z -0.0203169920 What am i doing wrong. Same thing occurs when i try to find child named "Bip01 Head".
  7. So i am trying to make some bulletholes. I made it just like in Leadwerks documents, but i got "Compile error Unable to convert from 'TEntity' to 'TMesh'. am.bullethole:TMesh = CreateDecal(spick.surface, TFormPoint(Vec3(spick.X, spick.Y, spick.Z), Null, spick.entity), 20.0/16.0, 32) EntityParent(am.bullethole , spick.entity, 0) PaintEntity(am.bullethole , LoadMaterial("abstract::fire.mat")) addMesh(am.bullethole, spick.entity) updatemesh(am.bullethole) Error is pointing me to AddMesh line and i understand error, but without addmesh there is no bulletholes. I followed this document: http://www.leadwerks...tle=CreateDecal
  8. Title explains everything. I need to raycast prevent to pick one type of entities. (player gun entity etc..). Raycast should go trough those entities.
  9. I just finished uploading the framework so that some friends can help out with the content and scene. I already have the overall theme and game put together, I just have to make them, and in this case get help with converting models, creating materials, and so forth. The framework is going extremely well. I've been working on it more than I should be to be honest but I did spend most of the day on the important matters. Plus it's Sunday for crying out loud. Anyways, I've changed several things about the framework. Here is a brief overview: Configuration is now available in the engine. This provided the gateway to the rest of the features I had plan for the framework, such as key/mouse binds, and generic configuration information for both the "engine" and "game." The key/mouse bind configuration file looks similar to: forward=w backward=s left=a right=d jump=space leap=lshift+space crouch=c | toggle fire=leftmouse aim=rightmouse grenade_toss=middlemouse | release grenade_cook=middlemouse debugphysics=f6 | toggle use=e It's fairly straight forward but the configuration file can contain basic instructions, such as "release" and "toggle." The configuration class itself provides the rest of the support. Examine the following, which is now accessible to Lua: if input:hit("leftmouse") == 1 then -- fire logic end if input:hit(input.get("use")) == 1 then -- use logic end if input:toggle("crouch") == 1 then -- do crouch end The engine configuration is managed with: config.get("resx") The game configuration is managed with: game.get("difficulty") One last feature I've added is a way to change between behaviors. These behaviors are strictly Lua, a hybrid, and strictly C/C++/C#/BlitzMax. If you provide the file "engine.lua" into the root of the project, the framework will only execute that LUA file after creating the graphics context and managers (config, input, game, etc.). The "hybrid" is a mix of the two. The framework calls upon specific Lua files at specific times. They could be looked at like "hooks." The Lua files are located at: "/scripts/dice" Examples are "update.lua" and "flip.lua." The framework also now handles scenes. It allows Leadwerks to process the scenes at the moment but then each entity in the scene to turn into an actor by the framework. This way you can get any actor: local actor = engine:getactor("myEditorAddedActorName") actor:translate(vec3(0,0,0)) actor:setkey("health", 20) Actors have their own Lua files and due to the structure described above we should be able to swap Lua files on the fly. The plan I will be attempting is similar to the following: local actor = engine:getactor("myactor") actor:setscript("newscript.lua") actor:runscript() I assume it will work, but who knows. Since per entity/actor scripts work the flexibility with the framework is fairly polished. I'm starting on default controller mechanics, soon to get into third person characters, and so on. Once my buddies can help me out I'll have more to test mechanics. Everyone should also check out Scarlet Thread Studios work, it looks to me like an RTS/TPS style framework, similar to Diablo series. Slight modifications can turn that into an RTS, FPS/RTS, and so on. Same with Pixel Perfect's engine Neutrino, which utilizes EKI One, and is turning out fantastic. I've bugged him to lease it but he isn't budging. Sorry everyone, lol. Just playing, Pixel. MG, always awesome work. Thanks for joining up to help with the content. Macklebee, hoping you'll come aboard and help me out with Lua. I'm really not in the mood to fully learn Lua at the moment. I plan to stick with hard-coded mechanics, lol. Read the above, it explains how to force the framework to let Lua control the main loop. Figured that would be your expertise. Awesome hangout session. I never planned to make it, thought it was out of my schedule, so it was kind of unexpected, lol. I had to register with Google+ and everything. It was fun, meant to talk about more, and to everyone else instead of just Josh, but I had to go AFK; turned out to be too long. I hope I'm invited to the next hangout but I don't have a camera. Thanks for reading.
  10. Paul Thomas

    And, Hello

    There are several here who already know me, but for those who don't, my name is Paul Thomas. I've been programming for a long time now; I started when I was 16 (I'm now 30) with HTML, CSS, Javascript, and CGI/Perl. Hell back then there wasn't a lot of people who even used the internet at home, lol. At least in my area, I'm sure others, especially in California, were a lot further ahead at that time in terms of technology and the interest in the technology. Through the years I've learned multiple languages from strictly web-based to software based. My interest in computers when I was 16 was to make a game, but at the time I thought it would have been much easier to prototype the whole idea in a web-based browser game. I had completed the browser game, which was the original "Eternal Crisis," and worked nicely. My plan was to update the entire web-based system, polish everything, and officially advertise (I had invited friends to play the game). That's when I learned about a "fried hard drive" and eventually learned about "backup" and how to install a hard drive. Those whom already know me, know what Eternal Crisis is, and my Blogger shows some of the history on that project. I had taken that project, along with another, over to Unreal Engine 3 because it best suit the project. Along the years of learning that engine I was using LE for prototyping ideas and so forth. While I'm not working on my own engine (temporarily titled "3D Dice"), FPS/RPG framework for UE3, or R.A.T.S., I work on my framework for Leadwerks Engine 2.5. I've never shared this framework before, in fact it always felt like I had to pull it out of a shallow grave each time I added to the framework design and programming. I'm a notebook junkie, I plan out mechanics, structures, and so forth on paper, before going over to digital. Old habbits that die hard I guess. Now I felt like sharing the progress, which isn't a lot, but it's a great start to me. It's a great start to me because it actually runs, lol. The state of the framework isn't even close to the final planned and written design, but progress is progress. Always move forward until it's finished, even if you can only pick that project up once every two weeks (by then I/you should probably take a look at your workload and fix it instead of attempting such project schedules; however this isn't vital to me and rates low on my importance scale), if it's updated then progress is moving forward. This is also harder to work with if you don't plan your software before actually programming (unless it's routine for you with available libraries for shortcuts in development). As most programmers should know, the programmers "update" isn't as glamorous as an artists "update" as it's not about visual stimulation but overall program/software flow. In the case of my LE framework (obviously untitled) it's all about providing mechanics and how that is achieved is important especially in the case of LUA access and how everything works together; from configuration/data management, to input binding, and all the way down to AI. Until occupied again by my other tasks I will eventually share the entire framework structure and I will always be showing examples of syntax; cause that's what programmers do. Just to clear the obvious questions that may come from the community: Q) Do I plan to give away code, the framework, and be an open source kind of person? A) No, not really. First of all, you would have to wait, to anyone else at the moment the framework is as useful is a partially finished library. How long you would have to wait would depend on how much time I can spend on the framework and in all honestly it's not much at all (read above, and actually read). Q) Do I plan to sell or lease the framework? A) No, don't think so. I even think that's against Leadwerks terms since it could be deemed an "FPS Creator," which is definitely in the terms. Q) Is my framework really that great? A) Nah, I mostly ramble, and I'm actually writing this to share with long time friends here at Leadwerks. Some won't even visit anywhere else to communicate because they are so used to using Leadwerks for that; it is indeed where we all met. Q) Who are my friends? A) I have none, it was a lie. Now, about this framework. This "framework" isn't the same, exactly, as the framework that comes with LE. The framework that comes with LE handles some dirty work for you when it comes to creating the worlds, cameras for those worlds, shader effects, and helper functions. The framework I'm designing is technically similar to a game engine. I personally consider Leadwerks Engine as a rendering API with physics and this framework uses that rendering API and provides mechanics. The mechanics the framework provides is what makes up the detail of the framework. INI SQL Application Graphics Game The above are considered "managers" in that they only handle what they should be managing. The "INI" only works with INI files, such as a configuration manager. The "SQL" only works with SQLite3, providing helper functions for easier SQL management, and so forth. There are more planned managers than the above, but these are what are completed in terms of programming. The only real interesting portion to discuss about the framework is within the "Game" manager itself. The game manager provides two special classes/managers; "Object" and "Actor." Actor inherits everything about an Object. What defines an Object is a game entity that is never interacted with by the player. Objects are useful as it can be used for multiple purposes without consuming a lot of resources for each "component" or "plugin" I'd like to add onto the framework. For example, a Timer would be an Object. You don't interact with a Timer in a game, but there is a timer running in the background. Example: class ETimer : public EObject { public: ETimer(void); virtual ~ETimer(void); void Initialize(void); void SetTimer(float StartTime); void StopTimer(); }; While working with the framework you would do something similar to: // EGame::EObject // EGame::Objects EObject Objects; // .. ETimer Timer; Objects.Add("Timer", Timer); // .. ETimer Timer = Objects.Get("Timer"); Timer.StartTimer(0.0); // .. Timer.StopTimer(); // inherited by EObject Timer.Unload(); An Actor inherits everything that defines an Object. The difference between the two is that an Actor is something that a player could see, hear, interact with, or can move, rotate, and so forth. If you can see how this is all going, everything starts extending the Actor, such as the character, weapon, or items. Here are some examples of working with Actors in the framework: // EGame::Actors Actors.Add("oilbarrel", "oilbarrel.gmf"); // .. Actors.Rotate("oilbarrel", vec3(10.0f, 0.0f, 10.0f)); // .. Actors.Translate("oilbarrel", vec3(10.0f, 0.0f, 0.0f)); // .. EActor barrel = Actors.Get("oilbarrel"); // rotate with interpolation barrel.Rotate(vec3(1.0f), 0.1f); barrel.Translate(vec3(0.0f, 1.0f, 0.0f), 0.1f); // .. EActor Barrel; // new name Barrel.Name = "barrel01"; // new mesh Barrel.LoadMesh("oildrum.gmf"); Actors.Edit("oilbarrel", Barrel); A quick overview of an Actor: //EActor ID Name Tag Parent Location Rotation Mesh Sounds Particles Each Actor can also have children which are also Actors. This provides another version of parent/child relationships but also provides additional benefits which will be discussed in later blogs. The ID and Name variables are provided by Object and the Object provides more variables, but is listed for importance. When creating an Actor it is automatically tagged for unique identification. In the above example "oilbarrel" is actually stored as "oilbarrel_0" and simply incremented for each Actor that is created. This is identified by the Actors "Tag". The "Name" variable is a forced name, therefore searching for an Actor by the name, with more than one Actor having the same name, the first result is returned. Actors will be automatically created properly for each entity in a scene. The framework will be using a custom scene manager and handles initial Actor creation. Programmers/Scripters can then add to the Actors list with C++ or LUA like the above examples. class MyGame : public EGame { public: void Load(void); void Update(float DeltaTime); // .. void MyGame::Load(void) { Actors.Add("custom_actor", "mymesh.gmf", "force_tag_name"); EActor actor = Actors.Get("custom_actor"); EActor actorCopy = Actors.GetTag("force_tag_name"); actor.Translate(vec3(0.0f)); } void MyGame::Update(float DeltaTime) { EActor actor = Actors.Get("custom_actor"); // interp move with speed and threshold option actor.Move(vec3(10.0f), 1.0f, 1.0f, 0.35f); } }; In upcoming blogs, when I do get the time, I'll post up some videos. Those selected for the invite only alpha testing will get their information on how to use the framework. Friends of mine that didn't get an invite and are interested in alpha testing please private message me; I most likely didn't send you the information because I figured you were busy with your own project(s). Well, out of time. Thanks for reading.
  11. Hello! How can i fetch entity from scene to position my another entity to it's position?
  12. Is there any command to get distance from point x, y, z to x2, y2, z2. I need to get distance from camera position to picked position.
  13. When i pick entity with camerapick(), i need to make force in that point. It works, but when it tries to make force at ground, it crashes. How can i check if entity is right kind?
  14. Is it possible to make OpenGL commands within BlitzMAX? Like if I wanted to Implement a custom particle system? Thanks
  15. Hello guys. This time, here is small utility, nothing spectacular, just smal library what will let you manage available screen size your GPU support, easy. You can also use it in main menu where you will setup all available resolutions and browse trough list, or automatically detect maximum resolution upon start and set screen, etc. So here are commands. So, first we need to initialize library. Global SCREEN_SIZE:TScreenSize SCREEN_SIZE = TScreenSize.Create(bitDepth:Int=32) bitDepth is your screen depth and by default is 32, and it means, supported resolutions will be for 32 bit depth. Now library is initialized. All available resolutions GPU support are accessible trough screen size modes. Screen size modes are nothing but indexes of array, where screen size is stored, for width and height. So, in order to know how many available resolutions we have, we will use this command: Global NUMBER_OF_AVAILABLE_RESOLUTIONS:Int NUMBER_OF_AVAILABLE_RESOLUTIONS = SCREEN_SIZE.get_number_of_modes_available() So, if you want to go trough list of all available resolutions, you will go from 0 to NUMBER_OF_AVAILABLE_RESOLUTIONS. If you want to set up screen size, you can do it like this: SCREEN_SIZE.size(width:Int=True, height:Int=False,mode_:Int=0,higherRes:Int=False) If width is true, returned size will be width. If height is true, height size will be returned. If mode is provided in range 0 to NUMBER_OF_AVAILABLE_RESOLUTIONS, It will be provided size for that mode, for width or height, depending which one is flagged true. If higherRes is true, it will be returned largest screen size for width or height, depending which one is flagged true. So, for example, if you want to setup your screen upon loading on to maximum resolution, since you dont know in advance what kind of GPU/Monitor will be used, and you want to set it higher so user can later change it, you will do simply this(example with framework): Global SCREEN_SIZE:TScreenSize SCREEN_SIZE = TScreenSize.Create(bitDepth:Int=32) Graphics(SCREEN_SIZE.size(,,, True), SCREEN_SIZE.size(False, True,, True), 32) LogStreamEnabled = False'AppLogMode equivalent Global FW:TFramewerk FW = TFramewerk.Create() If Not FW RuntimeError "Failed to initialize engine." ..and rest is history . By combining on many ways, you can have many use of it, from menu systems where screens will be detected, up to automatic initializations, etc.. Also, you dont have to sort out screen sizes. They are already sorted (0 means lovest resolution, SCREEN_SIZE.get_number_of_modes_available(), is the highest), so its easy. Anyway, you can see how to use lib in provided example, so it should be self explanatory. In case it doesnt work, let me know. INSTALLATION: As usual, copy e1.mod to mod folder, and include it as it was done in provided example, and you are good to go..cheerrsss... DOWNLOAD HERE: http://www.leadwerks.com/werkspace/files/file/351-screen-size-utility/
  16. ..im sorry for such post here..I would for sure send PM, if i know who reported library as a broken, in order to find whats wrong with it..so, whoever found it broken, please let me know..thank you..
  17. Ok, it was long time ago when i start my gamedev playing with Blitz3D. It have very simple commands, and make casual game on it very easy. When i bought Leadwerks it was very cool that it's handle most Blitz3D commands, and same handy for me. But... Collisions system some confused me. But nothing was to do - i start to use Leadwerks Newton based collisions. It realy rocks! Anyone want to have realistic physics in personal project. But Newton have some complexity in charachter controls, that's why Josh maked his own. All cool, Leadwerks controller very good for FPS games, or strategy, RPG - where charachter must walk on ground and be realistic. Working with Last Chapter and couple external projects i was found some complex places in charachter controller: 1. Swept collisions doesn't working a: If i will make game where my hero can fall from high places - he will fly by through florground (someone here saw this bug when robot in Last Chapter stacking in blocks) b: If enemy can punch player - it make very much velocity to push charachter controller, and player can just fly through thinn wall behind him. 2. If geometry of stair vertical faces will be not 90 degrees (0,1,0 vector), controller can handle it as heavy slope, and don't want to walk there You can put small boxes (bricks) to ground, and little turn it randomly - controller will stacking in it, and "step height" value doesn't matter to him. 3. Casual games need casual charachter, and in 2.5D jump'n'run platformer - some complex to stay controller on one value by axis, but leave physics responce to it. If geometry of physics world in such game will be not perpendicular each other - it make controller slide to leftright, and put it to z=0 value not be so handy. Or lets say it will by TDS when you fly by helicopter on one height from earth - collision with ground mountains will slide controller topdown. Same problem. 4. Controller have rectangle form by side Ok, we making RPG for example, and our hero walk little out platform, as i expecting - it slide down from it, but default controller will still stay over platform break. (Seems like Quake2 known bug) Ufff... it's harder on not native languge when i thinking in top of text What can i say, minib3d (Blitz3D) collisions not so powerfull as Newton system, but, as answers on my notes: 1. minib3d collisions always swept 2. Moveble body in minib3d is sphere or egg, so it good working with rough geometry 3. Wee simple PositionEntity body,entityx(body),entityy(body),0 and it never go anyway from z=0 4. Egg form, do you remember .... At last i connected minib3d and Leadwerks, it have same commands and conflict with each other, so i little rewrote minib3d library. Now there each command have "bb" prefix, and types too Like cam=bbCreateCamera() bbMoveEntity cam,0,0,-10 or ent:bbtEntity=bbCreateCube() Leadwerks as you guess can be any version. So code to connect them is very simple - i calculating moving of minib3d bodies, next set Leadwerks meshes to minib3d bodies positions.. and i have Blitz3D with full Leadwerks features tiny example ' init both Leadwerks and minib3d Framework leadwerks.engine Import sidesign.minib3d registerabstractpath AppDir ' Leadwerks ' Helper function to get position/rotation of minib3d tEntity and set it to Leadwerks tEntity Global tmp:tvec3=vec3() Function align_as(lw_entity:tentity,bb_entity:bbtentity) tmp.x=bbentityx(bb_entity) tmp.y=bbentityy(bb_entity) tmp.z=bbentityz(bb_entity) PositionEntity lw_entity,tmp tmp.x=bbentitypitch(bb_entity) tmp.y=bbentityyaw(bb_entity) tmp.z=bbentityroll(bb_entity) RotateEntity lw_entity,tmp End Function ' basic inits Graphics 800,600 ' Leadwerks createworld ' Leadwerks lw_cam=CreateCamera() ' Leadwerks MoveEntity lw_cam,vec3(0,0,-2) ' Leadwerks ' createing minib3d pivot and Leadwerks cube, in main loop we will rotate minib3d pivot, and set Leadwerks cube to this pivot orientation bb_body=bbCreatePivot() ' minib3d lw_cube=CreateCube() ' Leadwerks Repeat If KeyHit(key_escape) Or AppTerminate() End bbturnentity bb_body,1,2,3 ' minib3d align_as lw_cube,bb_body RenderWorld ' Leadwerks Flip 1 Forever complied minib3d module - just unpack to mod folder (ahh, known minib3d bug with TurnEntity there fixed ) To see minib3d API - just look at Blitz3D online help sidesign.mod.rar
  18. Hey, i want to use the lugi thing for a server application wich is not using leadwerks at all. I found this on blitzmax forums: http://www.blitzbasi...s.php?code=2579 its from joshk i tried it with the following: Include "glue.bmx" 'the generated gluecode Global lua:TLua = New tlua 'create the tlua type lua.dostring(str) Type test {expose} Method foo() Print "say ausgefuehrt" End Method End Type the content of the str string is this: (moved it out for better reading) print("test:") local dings = NewTest() dings.foo() the result that i got is: test: Lua error: [string "print("test:")..."]:3: attempt to index local 'dings' (a function value) executing a lua script works fine, but i the object pushing ist not working Dies someone knows what i made wrong? edit: it looks like i just made an . instead of an : so nevermind this thread, and sorry for bugging.
  19. This time, I have decided to introduce character animation control. There are several reasons for that. A lot of people asked me to give some example, and at same time, such library will be essential for following AI tutorials, so having said that, I have decided to introduce AI library, so it will be avoided confusion with corresponding command set in AI tutorials. I would like to also make note that all libraries I have released and Im planning to release, are a lite version of fully fledged feature set in game engine Im planning to sell, after my game is out, so all this is some sort of 'advert' what full version can do, in order to make people more interested about system. Now, lets go back to topic. During game development, one of important roles are game character animations. From programmer standpoint, control of animations must be very simple, much as possible, with same rules applicable to both, gameplay character, as well as NPC's. Even more, it is important to have ability to have character easy 'switchable' between player control or some other system (cut scene manager, AI control, scripted event). So, how is it done in this library?? Very simple. First of all, during design, you will notice that there are always certain animation 'groups'. Animation inside those groups, should fall under same control scheme. Of course, it is entirely possible to have different control scheme for each animation group, but it is NOT advisable. So what are those 'animation groups' ?? Let me explain on provided example. Lets assume that our character has 2 main pose(im not sure is this proper word). In short, lets say that our character can move in normal way (standing up pose) and crouch pose. Each of this poses I call a 'group' . Animations within each group use (should use, but its not necessary), same command set. For example, when character walk while in stand up pose, we use KEY_UP so character animating in WALK animation. When we switch to CROUCH (let say hit button C as usual in games), then SAME command (KEY_UP) will make character animating in WALK animation BUT in crouch pose. Also, while character doesnt move at all, it should be in 'STOP' animation. That animation plays main idle and if player doesnt do anything, system should play some of side idles, if available and after it plays, go back to main idle (like, Lara Croft, bored and play various animations if player doesnt do a thing)..Library giving ability for creation of infinite number of groups and infinite number of animations within groups, so its up to designer/programmer to utilize system properly Library command set is rather simple, and yet powerful, so lets see command set. 'CREATE ANIMATION FOR CHARACTER CHARACTER:Tanimation CHARACTER = TAnimation.Create("MyCharacter.gmf",IdleTriggerTime:Int=20000) MyCharacter.gmf Its animated character we want to control. IdleTriggerTime:Int=20000 This is time representing how long will be played main idle, before plays one of randomly choosen side idles, if any. So it is time what system will wait player, before switch to one of 'boring' animations. Its exposed in milliseconds, so default value is 20000 what is 20 seconds. 'ADD ANIMATION GROUP('S) CHARACTER.extract_sequence("ANIMATION GROUP NAME", "ANIMATION COMMAND NAME", firstFrame:Int, lastFrame:Int,playType:Int=CONTINOUS_LOOP, idleType:Int=MAIN_IDLE, transition:Float=0.0, speed:Float=1.0) This command will extract animation stored in given frame range, under ANIMATION COMMAND NAME and inside ANIMATION GROUP NAME. ANIMATION GROUP NAME Thisis name of specific animation group, what will contain specific animations. ANIMATION COMMAND NAME This is name of specific animation, what will be used to play specific animation, during gameplay. firstFrame First Frame of animation lastFrame Last Frame of animation playType It is flag representing way animation is played. It should be left in default value (CONTINOUS_LOOP), as other modes are used for internal processing as well as for some other libraries im about to introduce later, during AI lessons. Just for info, available flags are: -CONTINOUS_LOOP -ONE_LOOP_THEN_IDLE -ONE_LOOP_THEN_STOP But as i said, you SHOULD let it be default value only, as others are used for other things, we will see, later. idleType This flag tells to system what kind of animation is one to be loaded and therefore, how it will be treated. If animation is MAIN IDLE then flag is MAIN_IDLE. If animation is idle for 'bored' animation, then flag should be SIDE_IDLE. SIDE_IDLE animations are attached to MAIN_IDLE and after idleTriggerTime is elapsed, one of SIDE_IDLE animations will be played and then go back to MAIN_IDLE. If animation is not any kind of IDLE animations, then it should be flagged as NOT_IDLE. This flag will be our, walk, run, jump, die, etc, animations we control. So possible flags for animation types are: -MAIN_IDLE -SIDE_IDLE -NOT_IDLE transition This is value representing transition smoothnes between animations. speed This value representing animation speed. Default value is 1.0. 'INITIALIZE ANIMATION SETUP WE WANT TO START WITH CHARACTER.enable_initial_animation("ANIMATION GROUP NAME", "ANIMATION COMMAND NAME") This command will basically set choosen animation group as default one and play animation from that group with ANIMATION COMMAND NAME when program starts. Usually used to setup main idle play before game starts. In order to play some animation in runtime, we use command CHARACTER.play("ANIMATION COMMAND NAME") This command has to be called just once and system will play it, long as it is not called any other animation. During runtime, we want to switch from one animation group, to another. In order to do that, we use this command: CHARACTER.enable_animation_group("ANIMATION GROUP I WANT TO MAKE ACTIVE") CHARACTER.play("INITIAL ANIMATION NAME I WANT FROM JUST SELECTED ANIMATION GROUP") And thats pretty much all. If you wanna free from memory all stuff, during switching levels and what not, just do this: CHARACTER.Free() CHARACTER=Null ..and you are freeeeeee... I hope you guys will have some nice use of this library. Stay tuned as MUCH more comming.. NOTE: Inside zip file is EXE. you can run it in order to see how it works. EXE contain all shaders, dll's, etc so dont put it together with shader folder of yours. Character seen in EXE example, I cant share, but source code of example is kindly provided, so you just play with your own characters. Also, library consider that all animations are stored along ONE frame line, so keep that in mind. Installation is simple..just copy e1.mod folder in to your Bmax mod folder and you are good to go.. Library available here: http://www.leadwerks...ion-libraryzip/
  20. Hi I have downloaded the Demo Version of the Leadwerks Engine an wanted to test it with blitzmax. So i also wanted to test out the water: setwater(1) but the compiler says: Compile Error: Identifier 'setwater' not found Build Error: failed to compile But most other fuctions are working, such as lightning, physics,... Can you tell me please how it works with blitzmax?
  21. I was getting a reliable crash on GCCollect and finally traced the problem back to this. Never store externed C objects in a resizable array.
  22. I started working on this today, got it working, and figured I'd share. I still have more work to do but this is a good start. Could use cleaning up but that's for later. SuperStrict Import "-lpsapi" Const PROCESS_QUERY_INFORMATION:Int = $0400 Const PROCESS_VM_READ:Int = $0010 Const PROCESS_VM_WRITE:Int = $0020 Extern "Win32" Function GetLastError:Int() Function OpenProcess:Int(dwDesiredAccess:Int, bInheritHandle:Int, dwProcessId:Int) Function EnumProcesses(pProcessIds:Byte Ptr, cb:Int, pBytesReturned:Int Ptr)="EnumProcesses@12" Function EnumProcessModules(hProcess:Int, lphModule:Byte Ptr, cb:Int, lpcbNeeded:Int Ptr) Function GetModuleBaseName(hProcess:Int, hModule:Int, lpBaseName:Byte Ptr, nSize:Int) = "GetModuleBaseNameA@16" Function TerminateProcess(hProcess:Int, uExitCode:Int) Function CloseHandle(hObject:Int) Function GetModuleFileName(hModule:Int, lpFileName:Byte Ptr, nSize:Int) Function GetModuleFileNameExA(hProcess:Int, hModule:Int, lpFilename:Byte Ptr, nSize:Int) Function GetProcessImageFileNameA(hProcess:Int, lpImageFileName:Byte Ptr, nSize:Int) EndExtern ' enumerate all processes ' Function EnumerateProcesses:Int[]() Local pProcessIds:Byte Ptr Local cb:Int = 1024 Local bBytesReturned:Int Local processes:Int[] pProcessIds = MemAlloc(cb) If Not EnumProcesses(pProcessIds , cb, Varptr bBytesReturned) MemFree(pProcessIds ) Return Null EndIf processes = New Int[bBytesReturned / 4] MemCopy(Varptr processes[0], pProcessIds, bBytesReturned) MemFree(pProcessIds) Return processes EndFunction ' get process name from process id ' Function GetProcessName:String(id:Int) Local hProcess:Int Local hModule:Int = 0 Local lpBaseName:Byte Ptr[1024] Local nSize:Int = 1024 Local processName:String = "" hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, id) If hProcess = 0 Return "" GetModuleBaseName(hProcess, hModule, Varptr lpBaseName[0], nSize) processName = String.FromCString(lpBaseName) If processName = "?" Or processName = Null GetProcessImageFileNameA(hProcess, Varptr lpBaseName[0], nSize) processName = StripDir(String.FromCString(lpBaseName)) EndIf CloseHandle(hProcess) Return processName EndFunction ' EXAMPLE USEAGE ' Local pList:Int[] = EnumerateProcesses() If pList.length > 0 For Local i:Int = 0 To pList.length - 1 If pList[i] <> 0 Local pname:String = GetProcessName(pList[i]) If pname <> "" Notify(pname) EndIf Next EndIf
  23. I was going to try moving the Leadwerks3D code into a leadwerks.leadwerks3d module, but I discovered the namespace system doesn't really work when you try to override BRL's classes. You CAN specify brl.stream.TStream or leadwerks.leadwerks3D.TStream, but you get problems when you try importing another file in your code. Even if your imported code file includes both modules and explicitly declares the variable type using the namespace, the program still can't compile. The whole module/namespace system doesn't seem to be designed like it was meant to be taken seriously. Since BMX is free updates for life, I don't really this improving. I just reverted to the last SVN commit and will continue prefixing all functions and types with "LE".
  24. To prevent non Leadwerks Engine specific/Related entries from my Blog being automatically published here via the Blog Feed, I have removed that functionality, and will simply add a new entry title and link here for all Leadwerks Engine specific/Related entries. Leadwerks Related Blog Entry. Meet The Flockers.
  25. I spent all day working on this, rewrote the code a few times, a couple methods weren't reliable enough, and this is basically my last chance (before reverting to the best method so far). I'm using a named pipe from BlitzMax to my DLL. The message is sent but once I send another message it crashes the DLL loaded application (I can't specifically say what that application is, but this application loads/binds the DLL). I need to this to be a continuous evaluation for sent messages only to stop once I manually close the handle. If what I'm doing isn't doing that, please let me know how to fix it. I'm not very good with C++ and I haven't had much practice having BMax use Win32 external functions, although I got this to work on the first try, I brush it up on hair pulling luck. C++/DLL side: void BeginPipe() { _beginthread(BeginPipeThread, 0, NULL); } void BeginPipeThread(void* pParams) { LPTSTR _PIPE_NAME = L"\\\\.\\pipe\\RhysPipe"; char Received_Buffer[256]; DWORD BytesRead = 0; HANDLE hPIPE = CreateNamedPipe(_PIPE_NAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 256, 256, 10000, 0x00000000); if(hPIPE != INVALID_HANDLE_VALUE) { int Connected = 0; while(!(GetAsyncKeyState(VK_F8))) { Connected = ConnectNamedPipe(hPIPE, NULL); if(Connected == 1) { BOOL bRead = ReadFile(hPIPE, Received_Buffer, 256, &BytesRead, NULL); if(bRead != 0) { // write message for testing ofstream myfile; myfile.open("WriteTest.txt", ios::app); myfile << Received_Buffer << "\n"; myfile.close(); } } else { CloseHandle(hPIPE); } } } DisconnectNamedPipe(hPIPE); CloseHandle(hPIPE); } I execute "BeginPipe()" as this needs to be on a second thread to not freeze the application waiting for a message. And the BMax side: Const GENERIC_WRITE:Int = $40000000 Const OPEN_EXISTING:Int = 3 Const INVALID_HANDLE_VALUE:Int = -1 Extern "Win32" Function CreateFileA(lpFileName$z, dwDesiredAccess:Int, dwShareMode:Int, lpSecurityAttributes:Byte Ptr, dwCreationDisposition:Int, dwFlagsAndAttributes:Int, hTemplateFile:Int) Function WriteFile(hFile:Int, lpBuffer:Byte Ptr, nNumberOfBytesToWrite:Int, lpNumberOfBytesWritten:Int, lpOverlapped:OVERLAPPED) Function CloseHandle:Int(hObject:Int) Function CreateEventA:Int(lpEventAttributes:Int, bManualReset:Int, bInitialState:Int,lpName$z) EndExtern ' OVERLAPPED ' Type OVERLAPPED Field internal:Int Field internalHeight:Int Field offset:Int Field offsetHeight:Int Field hEvent:Int = CreateEventA(0, 0, 0, Null) Method Delete() If hEvent CloseHandle(hEvent) EndMethod EndType Global hFile:Int = CreateFileA("\\.\pipe\RhysPipe", GENERIC_WRITE, 0, Null, OPEN_EXISTING, 0, Null); Local buffer:Byte Ptr Local bytesWritten:Int Local MyString:String = "THIS IS A TEST FROM BMAX" buffer = MyString.ToCString() If hFile WriteFile(hFile, buffer, 256, bytesWritten, Null) EndIf Again, it works, but when sending a second message, it prints, and then crashes. Not exactly sure why but I'm too novice in C++. Any help would be appreciated.
  • Create New...