-
Posts
4,816 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by AggrorJorn
-
It was a simple test to check if the texture location was correct, and yes is was supposed to be drawn there. Lets try out severall drawImage commands. Replace the if statement with the following: if currentItem ~= nil and currentItem.texture ~= nil then context:SetBlendMode(Blend.Alpha) context:DrawImage(Texture:Load("Materials/items/bottleicon.tex"), x, y, self.itemSize.x, self.itemSize.y) context:DrawImage(currentItem.texture, 0, 0, self.itemSize.x, self.itemSize.y) context:DrawImage(currentItem.texture, x, y, 80, 80) context:SetBlendMode(Blend.Solid) end
-
Have you looked in the command reference? http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/texture/textureload-r341 You are missing a ')' after the texture path.
-
The position and scale needs to be added: context:DrawImage(Texture:Load("Materials/items/bottleicon.tex"), 0,0, 100, 100)
-
Can you post an ingame screenshot? It looks like the textures are missing, but I wonder why it isn't causing errors. Can you do a quick test by putting this line right after the PostRender function (assuming the location of the texture is correct): context:DrawImage(Texture:Load("Materials/items/bottleicon.tex", 0,0, 100, 100)
-
and are the inventory items drawn on the screen once you picked something up?
-
Replace the PostRender function with the script below. Tell us what the output is and whether your see something on screen. function Script:PostRender(context) for i = 1, self.itemSlots, 1 do context:SetColor(1,1,1) local x = self.screenWidth - self.itemSize.x local y = (i * self.itemSize.y) + (i * self.offset) context:DrawRect(x,y, self.itemSize.x, self.itemSize.y) local currentItem = self.items if currentItem ~= nil and currentItem.texture ~= nil then System:Print("going to draw a texture. i="..i..) context:SetBlendMode(Blend.Alpha) context:DrawImage(currentItem.texture, 0, 40 * i, 40, 40) context:SetBlendMode(Blend.Solid) end end end
-
Hi, You are mentioning 'flow gui system'. If it is actually FlowGUI you are using, there is an example start menu, with working start menu.
-
is self.p0 nil when you get it in the start function? self.p0 = self.entity:FindChild("p0") if self.p0 == nil then error("p0 is nill") end
-
@Josh: Those C++ tutorials are for Leadwerks 3.0 and are compatible with Leadwerks 3.5. Isn't it possbile to move them? @Roland: The indivual pages are now no longer visible, which is a pitty since they contain the video link, the C++ code and the Lua code. However, you can download the complete source pack for C++: http://www.leadwerks.com/werkspace/files/file/533-c-tutorials-31/
-
The overview can be seen even without login: http://leadwerks.wikidot.com/wiki:tutorials The C++ tutorial links are no longer viewable it seems Apparently those links no longer work without having clearance. http://www.leadwerks.com/werkspace/page/tutorials_legacy/_/introduction-to-animation-r14
-
But every character has this script attached right? So every item that has a collision with the ground will each call its own Collision Function.
-
Without source code it is hard see what is going on.
-
I remember using it for a written tutorial Josh asked me to make: http://www.leadwerks.com/werkspace/page/tutorials/_/script/introduction-to-lua-scripting-r103 But I can't seem to find it in the command reference.
-
You can use self.entity:SetScript("Scripts/myScript.lua")
-
Character bouncing with terrain or other entities
AggrorJorn replied to Skrakle's topic in Programming
You can use SetFriction() to prevent sliding. Also SetPosition, SetScale and SetRotation break the physics simulation. If you have an object that you want to move by physics, you can only use the Physics variant of the commands I listed in the previous line. -
Character bouncing with terrain or other entities
AggrorJorn replied to Skrakle's topic in Programming
If you use PhysicsSetPosition(), and your models are near each other, one of the models is placed inside the other model. This will result in twitching physics. Instead of using SetPosition(), push the player around with using forces. -
How to add dynamic text to an asset? Create Dialogue?
AggrorJorn replied to muddflap's topic in Programming
If you create an entity and want it to be a child of another entity, you can use the SetParent() command. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitysetparent-r187 -
Is your question how to make bump maps or to how to apply bumpmaps to your models? In case of the last question, models require a material. This material can have a diffuse textures as well as normal texture. See the material editor http://www.leadwerks.com/werkspace/page/documentation/_/user-guide/material-editor-r8 Via code: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/material/materialsettexture-r184 I would assume diffuse is index 0 and normal is index 1. But I haven't tested this.
-
You might also want to read up on C++ pointers. http://www.cplusplus.com/doc/tutorial/pointers/
-
Thanks, Okay try the following: The PlayerModel and Camera have no scripts. The Player has a script attached Script.rotateSpeed = 1.0 --float "Rotatespeed" function Script:UpdatePhysics() if App.window:KeyDown(Key.A) then self.entity:SetInput(Time:GetSpeed() * self.rotateSpeed ,0 ,0) end end [*]Adjust rotation value if needed.
-
I have no idea how this looks in your scene, can you give us a screenshot of your hierarchy. If you have multiple scripts for the player which both to self.entity:SetInput() things will start to go wrong. If you create a camera in the scene, you need to link it to the FPS player, since that script creates a camera via script. That means you have double camera's.
-
Okay to clarify, this is your hierarchy: FPSplayer (with modified FPSplayerscript, Character controller, Character Collision Type) Model (no script, not a character controller) If you have a script on your model as well, then this will conflict with the FPS player script attached to the parent. Can you otherwise send a screenshot of your hierachy.
-
Those are some viscous eagles. Nice work!
-
You are using the SetInput in both the UpdateWorld and the UpdatePhysics. Try commenting out the one in UpdateWorld.
-
Can you post your fps script?