Jump to content

RNG (LUA)


nakof
 Share

Recommended Posts

Standard LUA library calls.

 

math.random() -- generates float between 0 and 1

math.random(high) -- generates int 1 to high

math.random(low,high) -- generates int value low to high

 

and might want to use...

math.randomseed( os.time() ) -- seed for number generator

 

You can look these up (and more) in math section of the LUA documentation which is available at LUA.ORG

  • Upvote 1

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

I've done wrong?

RegisterAbstractPath("")
require("Scripts/constants/engine_const")
    Graphics(800,600)
    fw = CreateWorld()
    --create camera
    cam=CreateCamera()
    CameraClearColor(cam,Vec4(0,0,1,1))
    MoveEntity(cam,Vec3(0,0.85,-2))
    buffer=CreateBuffer(800,600,BUFFER_COLOR)

    --create light
    light=CreateSpotLight(8)
    RotateEntity(light,Vec3(20,45,0))
    EntityColor(light,Vec4(2,2,2,1))
    MoveEntity(light,Vec3(0,0,-5))
    SetShadowmapSize(light,1024)
    -- create body
    body = CreateBodyBox(1,1,1)
    body:SetMass(1)
    body:SetPosition(Vec3(0,2,2))
    EntityType(body,1)
    --create ground
    ground = CreateBodyBox(10,0.1,10)
    PositionEntity(ground,Vec3(0,-1,0))
    EntityType(ground,1)
    Collisions(1,1,1)
    DebugPhysics (1)

    while(KeyHit(KEY_ESCAPE)) ==0 do
		    fw:Update()
		    SetBuffer(buffer)
		    fw:Render()
		    SetBuffer(BackBuffer())
		    RenderLights(buffer)
		    Flip(0)
    end

 

why body does not fall?

Link to comment
Share on other sites

Hi nakof, you appear to have been using the evaluation version of Leadwerks for nearly three months now ... you sure you're not using an illegal copy of the SDK?

  • Upvote 4

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

I thought he went to Xors3D ...... odd that ...

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

This is effectively circumventing the protection put into the evaluation version to prevent people continuously using it. A months trial is sufficient for anyone who is seriously considering whether to buy the engine or not.

 

I'm sorry but if you wish to continue to receive support then please buy a full licence!

  • Upvote 2

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...