Page 9 of 10

Posted: 12 Nov 2015, 11:51
by Lotus006
Thanks Kevsoft for the "Defines" stuff it will be very usefull :D

Sorry also for the lack of without post anything, and also I re-re-work again on re-doing the code of my Inv. Menu and cheats menu stuff. :D

I reduced to 400 lines from about aprox. 1300 lines :) , but for now I'm stuck about to making a table for the inventory but I can't follow anymore because it wont work like I want. If some one can help me just to find a better way to stock items in my inventory (I mean more in a table) it could be very easier :)

there is an example about where I am now :P

Also I just show the necessary stuff in the code ( it's possible I missed some lines but you get the point :) )

I want to have a table look like but I know it can't work like this, but if anyone have an idea :D


The Code I want to do

Code: Select all

 -- 1= Mushroom, 2= FireFlowers, 3= Leaf, 4= IceFlowers, 5= Tanookie, 6= SledgeHammer ...

ItemsInvRow1 =  { 1,2,3,4,5,6 }
ItemsInvRow2 =  { 1,3,1,4,1,4 }
 -- Can up to five Row Stock



The code I have now

Code: Select all

[...]

ItemsSelSpritesPosX = {0, 5, 10, 15, 20, 25.3}
ItemsSelSpritesPosY = {-3, 0, -4, 0, 0, -3}



local UnItems1 = UnSelMushroom
local UnItems2 = UnSelflower
local UnItems3 = UnSeltanookie
local UnItems4 = UnSelleafsmb3
local UnItems5 = UnSelIceflower
local UnItems6 = UnSelHammer



local SelItems1 = SelMushroom
local SelItems2 = Selflower
local SelItems3 = Seltanookie
local SelItems4 = Selleafsmb3
local SelItems5 = SelIceflower
local SelItems6 = SelHammer

 

local PowerUpsSelSprites = {
SelItems1 ;
SelItems2 ;
SelItems3 ;
SelItems4 ;
SelItems5 ;
SelItems6
}

 

local PowerUpsUnSelSprites = {
 UnItems1 ;
 UnItems2 ;
 UnItems3 ;
 UnItems4 ;
 UnItems5 ;
 UnItems6
}



local powerupsitemsstock = {
PLAYER_BIG ;
PLAYER_FIREFLOWER ;
PLAYER_ICE ;
PLAYER_LEAF ;
PLAYER_TANOOKIE ;
PLAYER_SMALL ;
PLAYER_HAMMER
}


 function DebugMenuTest_API.onInitAPI()
   registerEvent(DebugMenuTest_API, "onLoop", "onLoopOverride");
    registerEvent(DebugMenuTest_API, "onLoad", "onLoadOverride");
    registerEvent(DebugMenuTest_API, "onInputUpdate", "onInputUpdateOverride");
   

 
 end

 
function DebugMenuTest_API.onLoopOverride()

[...]

 local TimerA = math.floor(PosItemsX)

 for k,v in pairs (PowerUpsUnSelSprites) do
 
 
 for i=1, GetLinePUpsUnSelSprites   do
 
      
Graphics.unplaceSprites( PowerUpsUnSelSprites[k])
       Graphics.placeSprite(1,  PowerUpsUnSelSprites[k] , 190 + 15 * ItemsSelSpritesPosX[k] , 535 + 1 * ItemsSelSpritesPosY[k]);    
      
       Graphics.unplaceSprites(PowerUpsSelSprites[TimerA])
   Graphics.placeSprite(1, PowerUpsSelSprites[TimerA], 190 + 15 * ItemsSelSpritesPosX[TimerA] , 535 + 1 * ItemsSelSpritesPosY[TimerA]);
 end



Image

Posted: 12 Nov 2015, 16:54
by Kevsoft

Code: Select all

local PowerUpsUnSelSprites = {
 UnItems1 ;
 UnItems2 ;
 UnItems3 ;
 UnItems4 ;
 UnItems5 ;
 UnItems6
}


I am pretty sure, that table elements are seperated by colons ",".

Posted: 12 Nov 2015, 22:24
by Lotus006
both are working I dont know why but about table is there a way to do like table replace instead of remove ?
when I remove some elements in my table PowerUpsUnSelSprites or the other one it's say that error :
Image

Posted: 13 Nov 2015, 12:27
by Kevsoft
I think you have to do it like that:

Code: Select all

local PowerUpsUnSelSprites = {
 UnItems1 = SelMushroom,
 UnItems2 = Selflower,
 UnItems3 = Seltanookie,
 UnItems4 = Selleafsmb3,
 UnItems5 = SelIceflower,
 UnItems6 = SelHammer
}

Posted: 14 Nov 2015, 10:18
by Kevsoft
LunaLua v0.7.2.2 has been released with following changes:
Spoiler
* Extended NPC class
* Bugfix [LunaLua]: Fixed Camera.width and Camera.height
* Bugfix [LunaLua]: Fixed the bug, where the functions Blocks.get and Blocks.getInterseting don't includes the last block.
* Added onNPCKill event
* Block can now be spawned with Block.spawn(...)

Posted: 15 Nov 2015, 10:40
by Lotus006
Cool Thnx for the update again Kevsoft :D

I think to rethink again (yep again lol damn) the way to implant slot in my Inventory :(

@Kevsoft, Is there a way to get the mouse position like in the level editor ?
or if not can you in a future update to get this feature possible ?

thanks in advance :P

Posted: 15 Nov 2015, 23:18
by Kevsoft
Lotus006 wrote:I think to rethink again
Feeling the same. Because I have to redesign some core LunaLua parts which eats my time. But you have to keep doing it.

Lotus006 wrote:@Kevsoft, Is there a way to get the mouse position like in the level editor ?
I add that to the wishlist, but don't expect that feature to come too soon.
If you have any more suggestions you can add them to the wiki here: http://wohlsoft.ru/pgewiki/LunaLua_Wishlist (you can use your forum login, to login into the wiki)

Posted: 5 Dec 2015, 5:51
by Sambo
The newest version broke SMBX. It won't run at all:
smbx quit working.PNG
smbx quit working.PNG (8.63 KiB) Viewed 1652 times

Posted: 5 Dec 2015, 10:01
by Kevsoft
Download the nightly build, but only copy SDL2_mixer_ext.dll

Posted: 5 Dec 2015, 15:40
by Wohlstand
Okay, I just fixed deploy: I appended updated SDL2_mixer_ext.dll and removed all generated ZIP's, so, people in next time are will not take same trouble ;-)

Posted: 30 Jan 2016, 11:25
by Kevsoft
LunaLua v0.7.3 is finally released. I apologize for the long waiting, but there where a lot of critical changes in this version.
Please make sure that your CC12 level is working with this version!

So here is the changelog:
Spoiler
* Custom images can now be drawn behind SMBX sprites.
* Hardcoded images can now be patched via hardcoded-*.png
* Added new compareLunaVersion for version checking
* Added new event onKeyboardPress which handles raw keyboard input
* Added new draw function (Graphics.draw [Named args])
* Added new OpenGL drawing system (Graphics.glDraw [Named args])
* Added new lua based pause function: Misc.pause, Misc.unpause, Misc.isPausedByLua
* Improvement [LunaLua]: Refactored mainV2.lua for better performance and smaller code
* Added new function for better controlling the loop: onTick, onTickEnd, onDraw, onDrawEnd
* Improvement [LunaLua]: onHUDDraw and onCameraUpdate now has the camera index as argument.
* Improvement [LunaLua]: onMessageBox can now be cancelled
* Added FIELD_BOOL which can be used for the mem-functions.
* Added NPC.get overload with only the npc-id as argument.
* Bugfix [LunaLua]: SMBX doesn't crash anymore, if you pass nil to some LunaLua functions.
* Improvement [LunaLua]: The max npc id is now 300
* Added NPC:harm
* Bugfix [LunaLua]: Tiles can now correctly be replaced with PNGs.
* Bugfix [LunaLua]: PlayerSetting.height was pointing to players width
* Extended Camera class
* Bugfix [LunaLua]: Cheat defines now don't reset.
* Added registerCustomEvent, so you can create custom events from your APIs.
* Added event onCameraUpdate and Camera.x, Camera.y is now writeable.
* Added a lot of new world map classes.
* Added Misc.doPSwitchRaw - You can now trigger the raw P-Switch effect.
* Added Misc.doPSwitch - You can now trigger the full P-Switch effect.
* Added Misc.doBombExplosion - You can now spawn bomb explosions.
* Bugfix [LunaLua]: Misc.resolveFile and Misc.resolveDirectory don't crash anymore and works faster now.
* Bugfix [LunaLua]: Some unreliability of Animation.spawn has been fixed.
* Bugfix [LunaLua]: Level sounds.ini now works correctly when using from the main game
* Bugfix [LunaLua]: Hitboxes and offsets are now reset before loading a new level or world
* Bugfix [LunaLua]: Misc.loadEpisode now works also without Autostart ini file.
* Added onStart - This event is the better "onLoad". This event will be executed, when SMBX is running the first frame.
* Fixed music.ini bug which wasn't supported track number suffix for NSF/HES/etc. multi-track musics
* NPCs can now be killed, even if they are hidden.
* Add width/height properties to LuaImageResource.
* Allow onNPCKill to be cancelled.

Posted: 6 Feb 2016, 2:49
by FanofSMBX
You know NPC defeat cancellation? Can this be changed so that there are new NPC codes that you can put in .txt? This would be convenient so I can pack these with my graphics.

Posted: 6 Feb 2016, 15:32
by Wohlstand
We are need to hook default NPC.txt parser and replace it with our (I already have PGE File Library which I can use to overwrite built-in NPC.txt and file parsers)

Posted: 1 Apr 2016, 16:23
by Kevsoft
Hey guys!

I have exciting news about the next version of LunaDLL. You can read about it here: http://wohlsoft.ru/

Posted: 1 Apr 2016, 16:37
by tb1024
Best april fools joke.

Posted: 1 Apr 2016, 16:45
by h2643
oh man i am sooo hyped!!!!1

Posted: 4 Apr 2016, 23:38
by lighthouse64
Wow can't wait for the release. (I'm so late though :P) -_-

Posted: 3 Dec 2016, 15:11
by Professor Moriarty
am I doing something wrong, or has Autocode been removed?

Posted: 3 Dec 2016, 20:48
by Kevsoft
Autocode has been deprecated but it does still work.

Posted: 4 Dec 2016, 4:29
by Wohlstand
Kevsoft, I'll append:
Professor Moriarty wrote:am I doing something wrong, or has Autocode been removed?
Just kept for compatibility with exists stuff. This part is no more takes updates. However, a quick guide to migrate from Autocode to Lua but keep same logic. Lua is much more flexible and embeddable language with wide community and usage purposes. Autocode is even not a Turing-complete language which lacks a lot of many common features.