Jump to content

Pancakes

Members
  • Posts

    1,204
  • Joined

  • Last visited

Posts posted by Pancakes

  1. Thanks a lot. It would have taken me a week to figure that out on my own.

     

    Looking at what you did I think I understand it. However when I copied your script and saved it, the in-editor property group was disabled for some reason. So I changed the property portion of the code back to the way I had it (basically copying Josh) and now it works perfectly.

     

    Here is the code right now.

     

    require("scripts/class")
    require("Scripts/math/vector")
    local class=CreateClass(...)
    
    function class:InitDialog(grid)
             local group
           self.super:InitDialog(grid)
           group=grid:FindGroup ("behavior")
           group:AddProperty ("TurnSpeed", PROPERTY_VEC3)
    end
    
    function class:CreateObject(model)
           local object=self.super:CreateObject(model)
    
           object.model:SetKey("turnspeed","1,1,1")
    
           function object:SetKey(key,value)
                   if key=="turnspeed" then
                           self.turnspeed = StringToVec3(value)
                   else
                           return self.super:SetKey(key,value)
                   end
                   return 1
           end
    
           function object:Render()
                   self.model:Turn(self.turnspeed,1)
           end
    end

     

    Thanks a lot! That's a really big help for me. I remember StringToVec3 from CryEngine Flowgraphs Lua has it too :lol:

  2. Hello I have a custom property to simply get an object to turn. Can I get a quick rundown on what I've done wrong? Thanks

     

    
    require("scripts/class")
    
    
    local class=CreateClass(...)
    
    function class:InitDialog(grid)
    local group
    self.super:InitDialog(grid)
    group=grid:FindGroup ("Behavior")
    group:AddProperty ("TurnSpeed", PROPERTY_FLOAT)
    end
    
    
    
    function class:CreateObject(model)
           local object=self.super:CreateObject(model)
    
    
    
    function object:SetKey(key,value)
    if key=="TurnSpeed" then
    	object:Turnf(value,0,0,0)
    	object:Render()
    	end
    end
    
    
    
    
    end

  3. Glad it helped. So at the places where you hit a model or the scene there are now appearing boxes?

     

    Yes. It's really cool. Those boxes could theoretically be chickens or decals or black holes and THINGOIDS. :unsure:

    post-672-12693056977157_thumb.png

  4. Looks like a depth buffer effect to me. The same kind of thing they use for underwater effects.

     

    You could tell it to artificially increase the depth value of things that are proportionally distant from the camera or occluded from the character's line of sight. Then cast a foggy effect in areas where the depth value is past a certain threshhold.

     

    I think that's what you're talking maybe. If not ignore.

  5. right after Setworld I would try something like this:

     

    cube = CreateCube()
    cube:SetScale(0.2,0.2,0.2)
    cube:SetPosition( pick.position )
    

     

    Don't know if it works. Can't run the engine on my laptop atm.

     

    ahh, you know what that's what I tried to do but I put it on the wrong place, thanks

     

     

    btw SetScale gives an error "value at index 2 is not an object", I think I'm supposed to use ScaleMesh but I need to test that out some more

     

    ah, left out the Vec3

     

    okay that was a big help thanks a lot

  6. Hello, I'm getting my first lua scripting by messing around with Josh's Bullet.lua

     

    I have some experience with Python and javascript but sometimes I'm an idiot. It would help me a lot if I could get some basic answers to some basic questions.

    Just to get used to Lua I'm just trying to make a cube spawn whereever a bullet hits a model. How would I do that?

     

    I tried some attempts last night but all I did was make the game slow down. Here is what the script looks like unmodified just as a reminder.

     

     

     

     

    function UpdateBullets()
    local bullet
    local pick
    local nextpos = Vec3(0)
    local emitter,model
    local bulletforce
    
    
    for bullet,nothing in pairs(bullets) do
    
    	if PointDistance(bullet.origin,bullet.position)>BULLET_MAXRANGE then
    		bullet:Free()
    	else
    		nextpos.x = bullet.position.x + bullet.velocity.x / 60.0
    		nextpos.y = bullet.position.y + bullet.velocity.y / 60.0
    		nextpos.z = bullet.position.z + bullet.velocity.z / 60.0
    		pick = LinePick( bullet.position, nextpos )
    		bullet.position.x = nextpos.x
    		bullet.position.y = nextpos.y
    		bullet.position.z = nextpos.z
    		if pick~=nil then
    			SetWorld(fw.transparency.world)
    			emitter=CreateEmitter(5,700,pick.normal,1)
    			emitter:SetVelocity( pick.normal )
    			emitter:SetRadius(0.1,0.5)
    			emitter:SetWaver(10)
    			emitter:SetColorf(0.5,0.5,0.5,0.1)
    			emitter:Paint(material_impactdust)
    			emitter:SetPosition( pick.position )
    			emitter:SetRotationSpeed(0.1)
    			SetWorld(fw.main.world)
    
    			model=GetMeshModel(pick.entity)
    			if model~=nil then
    				bulletforce = bullet.velocity:Normalize()				
    				d=-Dot(pick.normal,bulletforce)
    				d=math.max(0,d)
    				bulletforce.x = bulletforce.x * impactforce-- * d
    				bulletforce.y = bulletforce.y * impactforce-- * d
    				bulletforce.z = bulletforce.z * impactforce-- * d
    				model:AddForceAtPoint( bulletforce, pick.position )
    
    			end
    
    			bullet:Free()
    		end
    	end
    end
    end
    

     

    Thanks

  7. Hello, I bought the upgrade last night, I received the email and my status on the site has been updated, but my registration key doesn't work for whisper or josh's sdk updaters? Am I doing something wrong? I am running as administrator.

     

    Josh's updater says "Invalid Password" even though I copy and pasted my registration key that works on previous versions.

     

    Whisper's updater says "401 Unauthorized" then it crashes.

  8. I just made my paypal payment. So hopefully i'll receive a dl link within 24 hours. I have a little bit of javascript and python experience. I'll see whether I am able to contribute some thingoids of my own after studying yours of course. This could be a great way for me to learn about Lua.

  9. yeah i upgraded from a 8800gt and to be honest there isn't that big of a difference between 8800gt and the one i have now that's in my sig i forget what it's called :)

     

    the biggest difference was getting a new processor from by old q6600 to what i have now because it relieved a bottleneck

     

    so 9800gtx is a good value, the rest of the cards are a waste of money relativly speaking

  10. Oh plz yes I love it thank you!

     

    Plz! :)

     

    I have to say that pivot system by itself is brilliant.

     

    As far as the objects being linked to the inventory, I think that if a system like this was officially adopted by LE then it might be helpful to have a filter or layer system for viewing all links. This is really good! It's great!

     

    I'll be taking a very close look at actually using this as soon as I get my purchase through for 2.3 which will be this coming week.

     

    This is really great for me I appreciate it a lot.

  11. Now... you see that confuses me? Im sure your right and it just my physics math thats **** but... if i hold to small boxes, same size same shape exactly the same but one is full of stones the other isnt and i drop them both from the same height.. which one will get the floor first? Im sure if they had long enough to fall they will reach max velocity and be falling the same but the weight one will initially fall faster?

     

    Andy

     

    here's my take on it:

     

    the cardboard box is not air tight and even if it were airtight you'd still have to account for the fact that here on earth all objects are submerged inside of a gigantic sea of air, and therefore a sort of gaseous buoyancy becomes a factor particularly when you are speaking of gas molecules such as helium or just normal air trapped inside of an airtight cardboard box. And the box that has more air inside is going to become more buoyant. Therefore it actually has forces which are acting against the "pull straight down effect" of gravity, it's not that gravity is acting on the box any less than the one that is filled with stones, it's just gravity is behaving differently because the composition of the two object/mixtures is different.

     

    am i completely off base here :)

  12. I saw an FFT water implementation using OpenCL at the Khronos booth, and it was really beautiful. Trying to find the demo. That's what I want to use.

     

    you mean you're going to include it in the SDK/Editor? That would be very awesome.

  13. just to get off topic slightly, but why are you adding a texture to your wall when you are dictating the color by the vertex color? Are you doing something in particular in the mat file like adding a bumpmap or adding specular that requires a texture... just curious...

     

    I think his vertex colors are for AO only, the textures will give the rooms different diffuse colors.

     

    I like to jump into others' conversations :)

×
×
  • Create New...