-
Posts
124 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by AndyGFX
-
-
1) Language: Human. Why? Because it can precompile to C++ or BlitzMax (or any other language if people are interested to write configs for it). So only once source code needed.
2) Wiki. I don't want to download all kinds of PDF files, but have a quick look at them online first.
I agree.
-
Oops. Sorry. When i good remember, for lua exist clibs - luagl and luaglu, but i newer tried it from LE - maybe don't work becuase LE has LUA interpreter included to core of LE.
-
Very good idea
1) Language: BMX. Why? Because it's and will be primary language (by Josh's last words) *
2) Blog/Tutorial: Hmm it's hard. Blog looks like modern wave of this age, nothing more.
* When i started with 3D a lot of years ago, i was every day on NEHE, this page has a lot of basic tutorials and everyone is writed in same language, and at end of tutorial is added download section with links to other language conversions. I think this is way from my point of view.
All tutorials in ONE language with download links to others conversion.
Note: This idea give me new "fresh air" to my life, because i haven't time now to make any game project (i have new house and I'm surpised how many time need it from my free-time ), but i can help with this idea when you want.
-
I think that for you is now best way, learn LUA with LE Scene editor.
You need know, how lua works, then how it works in LE Scene and after this goals to learning, you are partly ready to use lua in BMX or other language.
-
When you need change font size, use glScalef. I know, ins't ideal, but works.
-
A few minuts ago, i tried update from LESDK, but upload crash with:
2 files to update.
Downloading "Maps/deserthighway_alpha.dds"...
Downloading "Maps/terrain_arctic_alpha.dds"...
File "Maps/deserthighway_alpha.dds" does not match server file size.
Server says it should be 16777376 bytes, but the downloaded file is 0 bytes.
File "Maps/terrain_arctic_alpha.dds" does not match server file size.
Server says it should be 16777376 bytes, but the downloaded file is 0 bytes.
Update completed in 7 seconds.
-
mhh but this is not what i expect,
I not want to do something with the entity-lua scripts, I only want that for the entity´s and nothing more
the item scripts should be separate...
I have another question, is it possible to create a lua class from blitzmax and/or invoke functions from within blitzmax
like this :
function classname:Bla()
?
When you want call existing function in lua script you need add to BMX code this part:
C sample:
http://www.lua.org/manual/2.1/subsection3_7_6.html
DELPHI sample:
// call LUA function function ExecuteFunction(functionname: pchar): pchar; begin if (enabled = false) then exit; lua_getglobal(VM, functionname); lua_call(VM, 0, 1); result := lua_tostring(VM, 1); //result:=0; end; // call LUA function with int arg function ExecuteFunction(functionname: pchar;val:integer): pchar; var state:integer; begin lua_getglobal(VM, functionname); state := lua_type(VM,-1); lua_pushnumber(VM, val); if (state=LUA_TFUNCTION) then lua_call(VM, 1, 0); end;
And at end, my TIP:
- add PUB.LUA to your BMX source
- then you have this very useful functions added:
Function lua_dobuffer:Int (lua_state:Byte Ptr, buff:String, sz:Int, name:String) Function lua_dofile:Int (lua_state:Byte Ptr, filename:String) Function lua_dostring:Int (lua_state:Byte Ptr, str:String)
and many others.
-
Q#1: Why you don't write string to a file and then call with RunScript?
Q#2: Why you have inserted XML between Lua script and BMX? Why you don't write your class Item like lua class?
TItemClass = {} function TItemClass:New() o = { bItem_Used = false } setmetatable(o, self) self.__index = self return o end function TItemClass:OnPick() self.light = CreateSpotLight() self.light:Hide() end function TItemClass:OnUseSwitch() if (self.bItem_Used==true) then self.light:Show() else self.light:Hide() end end function TItemClass:OnUpdate() -- ... end
-
File Name:Save data to lua syntax (as text/compressed)
File Submitter: AndyGFX
File Submitted: 01 Jun 2010
File Updated: 01 Jun 2010
File Category: Lua Scripts
I wrote TStoreData.lua class for simple save data to standard lua format, which is simple to read back to script (described here: HowTo using LUA script as data file)
Example: Save Data
require ("class/TStoreData") test_data = { pos = {0,1,2}, name = "player1", other = { items = {"item1","item2","item3"}, subitems = {"A","B"}, data = { x = 0, y = 1, z= 2}, tree = { leaf1 = "l1", leaf2 = "2", leaf3 = { leaf31 = "31", leaf32 = "32"}, used = true } } } DataSaver = TStoreData:New() -- save uncompressed data DataSaver:Save("result.lua",false,test_data) -- save compressed data -- DataSaver:Save("result.lua",true,test_data)
Output:
return { ["other"] = { ["items"] = { [1] = "item1"; [2] = "item2"; [3] = "item3"; }; ["subitems"] = { [1] = "A"; [2] = "B"; }; ["data"] = { ["y"] = 1; ["x"] = 0; ["z"] = 2; }; ["tree"] = { ["used"] = true; ["leaf3"] = { ["leaf32"] = "32"; ["leaf31"] = "31"; }; ["leaf1"] = "l1"; ["leaf2"] = "2"; }; }; ["name"] = "player1"; ["pos"] = { [1] = 0; [2] = 1; [3] = 2; }; }
Example#1: Load Data
GameData = dofile("result.lua") print(GameData.pos[1],GameData.pos[2],GameData.pos[3]) print(GameData.name) print(GameData.other.items[1]) print(GameData.other.items[2]) print(GameData.other.items[3])
Example#2: Load Data
require ("class/TStoreData") LoadData = TStoreData:New() GameData = LoadData:Load("result.lua") print(GameData.pos[1],GameData.pos[2],GameData.pos[3]) print(GameData.name) print(GameData.other.items[1]) print(GameData.other.items[2]) print(GameData.other.items[3])
Note: Saved format looks little bit different, but this saved format is only other lua syntax. Work same like before.
- 2
-
AppLog(str text, int flags)
where flag is:
APPLOG_ERROR
APPLOG_NORMAL
APPLOG_WARNING
Command is same for Lua/BMX/C++
-
Second strange thing is, why bullet.lua with cyclemode=1 works (is used in fpscontroller.lua).
... 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) ...
Note: Looks like for Lua LE API is this issue fixed.
-
Try change alpha color to 0.0125 with 80 particles, and then same alpha with only one particle.
particle2 = CreateEmitter(80, 500, Vec3(0, 4, 0), 1)
EntityColor(particle2, Vec4(1, 0.5, 0.25, 0.0125))
particle2 = CreateEmitter(1, 500, Vec3(0, 4, 0), 1)
EntityColor(particle2, Vec4(1, 0.5, 0.25, 0.0125))
Edit:
Because emitter is moved in same velocity as is defined for particles nodes, then all new particles are created on actual node position and sum of all alpha is >1 => without transparency.
-
The "seems brighter" is, because all 80 particles are created on same place, and for this I think, that is bug.
-
Any news about this ... ?
-
of course
method #1
os.execute("luac -o game.data game.lua")
method #2
os.execute("path to bat file, where bat file contains luac ....")
EDIT:
When you haven't installed full LUA libs for windows, use this link http://code.google.com/p/luaforwindows/downloads/detail?name=LuaForWindows_v5.1.4-37.exe'>http://code.google.com/p/luaforwindows/downloads/detail?name=LuaForWindows_v5.1.4-37.exe from main page: http://code.google.com/p/luaforwindows/
-
int Global 0 = local space , 1 = global space
http://www.leadwerks.com/wiki/index.php?title=Entities#PositionEntity
-
4. Instant feedback. No "Apply" button any more.
"Apply" button and checkbox [x] Autoupdate
-
@Joh:
When you need BEAM type sprite, best way is write "Axis Aligned Billboard" i have this code writed in Pascal, BMX and for Java, when you want I send you my code, or from this link AAB is in C++.
EDIT:
Why wait, when you need it, here are my codes: Axis Aligned Billboard (Pascal, Bmx, Java ))
- 1
-
TGLFont instead TFont
Font1:TGLFont=LoadFont(...)
-
I´m sent code to your PM
-
Loaded color scheme isn't applied on Editor.
-
-
Isn't comlicated.
Example
Base screen resolution = 1024x768 (HUD is designed for this res.)
User defined resolution after start is now: 1280x1024
Math (new_res/base_res):
hud_x_scale = 1280/1024
hud_y_scale = 1024/768
and for all HUD elements you need calc new position:
new_x = hud_x_scale * item_x
new_y = hud_y_scale * item_y
and size:
new_w = hud_x_scale * item_w
new_h = hud_y_scale * item_h
and draw it.
Note: You don't need create different images when are designed for max resolution.
-
You need calc scale coef. for base screen resolution, then draw all HUD items multiplied by new scale (position and size).
How to run a lua code string from blitzmax ?
in Programming
Posted