YouGroove Posted March 5, 2013 Share Posted March 5, 2013 What we can't do is copy and paste scripts in the same foledr and view like you created a new one Copy is displayed and you copy. But Paste do'nt appear ? And we don't have rename also ? (that could be usefull for new copied scripts) Quote Stop toying and make games Link to comment Share on other sites More sharing options...
cassius Posted March 5, 2013 Share Posted March 5, 2013 I have been studying the scripts for darkness awaits and understand what they do but I can;t figure out how they are called and from where they are called Whats the sequence of events? I just don;t get this engine(yet). Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
YouGroove Posted March 5, 2013 Share Posted March 5, 2013 Cassius : It's like lot of other engine framworks : You have start() All inits will be here for the model attached to that script UpdatePhysics() Will be called each frame of the game, here you'll manage AI, animations fo your character for example or any other stuff Each script that is binded so something in the scene : Barabarian, light, a cube model etc ... will be called each frame of the game. For example you put 2 goblins and attach goblinAI to each : The engine will know : Goblin1 driven by GoblinAI.lua Goblin2 driven by GoblinAI.lua Running the game : Each frame the engine will look up at models, when it will encounter Goblins, because they have GolbinAI attached, the engine will call GoblinAI on each goblin. the game will call each frame the updatePhysics() of each 2 scripts: GoblinAI for goblin 1 GoblinAI for goblin 2 Because variable delcared in GoblinAI are not public , it means for example HEalth variable or state_Ai variables are created for each goblin. You can see that as instances : Attaching GoblinAI to goblin1 in the scene create some GoblinAI instance that will manage golbin1 Attaching GoblinAI to goblin2 in the scene create some GoblinAI other new in memory instance that will manage golbin2 You can attach as many scripts to a model or character because the script always refers to the model it is attached to. Perhaps it should be a section later on User Guide explaining that to people not knwoing events and game frameworks ? 1 Quote Stop toying and make games Link to comment Share on other sites More sharing options...
cassius Posted March 5, 2013 Share Posted March 5, 2013 I understand events. Got them in my le2 game. Thanks. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
cassius Posted March 5, 2013 Share Posted March 5, 2013 if I add a goblin to the scene,how do I attach it. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Josh Posted March 5, 2013 Share Posted March 5, 2013 Right click in the scene tree and select Add Script. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
cassius Posted March 5, 2013 Share Posted March 5, 2013 added a goblin to the scene and added scripts. It did not move. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Josh Posted March 5, 2013 Share Posted March 5, 2013 Set the mass to >0 and set the physics mode to character. Of course, he won't move unless there is a reason for him to, so he needs a player to attack. Add the animation manager script to see his animation in motion. Or you can just drop in the goblin prefab and not worry about it. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
shadmar Posted March 5, 2013 Share Posted March 5, 2013 Is there any easy method to copy positions and rotation from one prefab to another (when using different ones) In the editor. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Josh Posted March 5, 2013 Share Posted March 5, 2013 Other than copying each field, no, not right now. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
cassius Posted March 5, 2013 Share Posted March 5, 2013 It worked when I copied and pasted the second goblin but not before. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
YouGroove Posted March 5, 2013 Share Posted March 5, 2013 Straneg ? Golbins don't attack each other in the game ? The Goblin should attack player only ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 5, 2013 Author Share Posted March 5, 2013 Straneg ? Golbins don't attack each other in the game ? The Goblin should attack player only ? They will only attack players: function EnemyAttackForEachEntityInAABBDoCallback(entity,extra) if extra~=entity then if entity.player~=nil then extra.goblinai:AttackEnemy(entity.player) end end end Quote Link to comment Share on other sites More sharing options...
YouGroove Posted March 5, 2013 Share Posted March 5, 2013 if entity.player~=nil then Yes so why the game worked when Cassius added a goblin ? i thin he added the player also befoe, if not the goblins won't move. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
cassius Posted March 6, 2013 Share Posted March 6, 2013 I just pasted the goblin from the one already in the scene.I suppose its scripts were copied too. The goblins don;t fight each other. I am missing something cos when I just drag a character on scene and add script it don;t move. But i am using the eval version. I won;t purchase until I fully understand how it works. Funny enough my le 2 game is very similar to Darkness awaits. It has a castle with red carpet and sword fights, The enemies also follow player everywhere. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
YouGroove Posted March 6, 2013 Share Posted March 6, 2013 I am missing something cos when I just drag a character on scene and add script it don;t move.But i am using the eval version. I won;t purchase until I fully understand how it works. Sorry, but you'll have to learn scripting. A character will only move , if the script you attached make it move. If you attached GoblinAI.LUA scritp , this script only moves when it finds a character with a script named "Player" attached to it : if entity.player~=nil then This means : entity : this is the model found by detection code .player : Is the name of the script attached to that entity so entity.player means AN ENTITY WHOSE ATTACHED SCRIPT IS NAMED PLAYER. Or am i wrong and didn't understood anything ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
shadmar Posted March 6, 2013 Share Posted March 6, 2013 I was watching Andy's : http://www.leadwerks.com/werkspace/page/videos/_/-r192 And immediately thought of portal somehow. Is it possible to render a camera to a texture? Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 6, 2013 Author Share Posted March 6, 2013 I was watching Andy's : http://www.leadwerks.../videos/_/-r192 And immediately thought of portal somehow. Is it possible to render a camera to a texture? Josh says that buffers similar to LE2 are in the code, but not officially supported at this time. Quote Link to comment Share on other sites More sharing options...
Josh Posted March 6, 2013 Share Posted March 6, 2013 The GL 4 renderer actually has MSAA buffers, but it's not ready of course. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
shadmar Posted March 6, 2013 Share Posted March 6, 2013 Ok, no problem. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
tjheldna Posted March 7, 2013 Share Posted March 7, 2013 Hi Does anyone know how to set a custom collision type like you could do in LE 2.5 in LE3 (C++)? Cheers! Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted March 7, 2013 Share Posted March 7, 2013 yeah... Andy's scene does sorta remind you of Portal, doesn't it.... same (similar) artwork style... similar lighting... --Mike Quote Link to comment Share on other sites More sharing options...
shadmar Posted March 7, 2013 Share Posted March 7, 2013 Is there currently any method I can pass a varying to all shaders in one go without looping through all materials form all surfaces to find shader and send shader:SetFloat ? (like for fog if I wanted) If not could maybe mat files be used for custom varys. Or maybe a Shader:SetGlobalFloat/vec2,3,4.. for a push out to all. (not so sure if that would be smart either) 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Admin Posted March 7, 2013 Share Posted March 7, 2013 There's a couple ways to approach this: material hooks, shader hooks, or global shader variables. I will have to think about it and see which is most efficient. I don't want any real-time string comparisons to be used. Because this is highly repetitive code. 1 Quote Link to comment Share on other sites More sharing options...
tjheldna Posted March 10, 2013 Share Posted March 10, 2013 Sorry to bump but anyone know how to set custom collision types in Leadwerks 3? I know how to set a collision type. Cheers! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.