View topic - To Game-Devs: The "n" entry in array-like tables was removed



All times are UTC + 1 hour


Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: 06 Jul 2011, 20:54 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
abma wrote:
@Forb:

its minor because the change is backwards-compatible. if you fix the "n"'s, it will work in the old engine, too.
The engine change is not backward compatible.

However, games can be made forward compatible.


Top
 Offline Profile  
 
PostPosted: 06 Jul 2011, 20:56 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
the change(s) that have to be done in games are backwards compatible.
it is just a different way of looking at it (engine-change or game-change).


Top
 Offline Profile  
 
PostPosted: 06 Jul 2011, 20:59 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
When they said Windows was backward compatible, then didn't mean every single DOS games had to be remade to work under Windows.


Top
 Offline Profile  
 
PostPosted: 06 Jul 2011, 21:31 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
Code:
LuaRules\draw.lua                                                    6      if (not arg) then arg = {...}; arg.n = #arg end
LuaRules\Gadgets\LuaCOB.lua                                         46                                  for i = 1, c.n do
LuaRules\Gadgets\lups_flame_jitter.lua                             193        particleList.n = particleCnt
LuaRules\Gadgets\unit_morph.lua                                    486    for i = 2, cmds.n do  -- skip the first command (CMD_MORPH)
LuaRules\Gadgets\customunitshaders\unitmaterials\0_angleshark.lua   18    if (info.n ~= curFrame) then
LuaRules\Gadgets\customunitshaders\unitmaterials\0_angleshark.lua   19      info.n = curFrame;
LuaRules\utilities\json.lua                                        342  -- We consider any table an array if it has indexes 1..n for its n items, and no
LuaUI\Widgets\gui_chiliselections.lua                              896                  selectedUnitsByDef.n     = nil
LuaUI\Widgets\gui_chili_integral_menu.lua                          749          widgetHandler.commands.n = cmdCount
LuaUI\Widgets\unit_group_move.lua                                   29                  if selUnits.n > 1 then
LuaUI\Widgets\unit_healthbars.lua                                  202      for i=1,ud.weapons.n do
LuaUI\Widgets\unit_rangerings.lua                                   67     selUnits.n = nil -- So our loop works


This is my list so far. Of course this doesn't include the [n] stuff, but whatever. Half this shit breaks the moment I touch it.


Top
 Offline Profile  
 
PostPosted: 06 Jul 2011, 21:53 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08

  • LuraRules\draw.lua 6 if (not arg) then arg = {...}; arg.n = #arg end
    WTF is this if select == nil ?? Doesn't make any sense! I'd say delete it, and see if anything breaks.

  • LuaRules\Gadgets\LuaCOB.lua 46 for i = 1, c.n do
    for i = 1, #c do

  • LuaRules\Gadgets\lups_flame_jitter.lua 193 particleList.n = particleCnt
    Do not touch! This is not an "engine" .n, but a custom one with an entirely different meaning.

  • LuaRules\Gadgets\unit_morph.lua 486 for i = 2, cmds.n do -- skip the first command (CMD_MORPH)
    for i = 2, #cmds do

  • LuaRules\Gadgets\customunitshaders\unitmaterials\0_angleshark.lua 18 if (info.n ~= curFrame) then
    LuaRules\Gadgets\customunitshaders\unitmaterials\0_angleshark.lua 19 info.n = curFrame;
    Custom .n! Do not touch!

  • LuaRules\utilities\json.lua 342 -- We consider any table an array if it has indexes 1..n for its n items, and no
    Uh. This is in a comment. You know what's a comment? Also, if you didn't see it was a comment, use a Notepad++ or any other editor with Lua syntax coloring

  • LuaUI\Widgets\gui_chiliselections.lua 896 selectedUnitsByDef.n = nil
    Remove that line, and below, change:
    or i,v in pairs(selectedUnitsByDef)
    into:
    or i,v in ipairs(selectedUnitsByDef)

  • LuaUI\Widgets\gui_chili_integral_menu.lua 749 widgetHandler.commands.n = cmdCount
    Uh oh, this one is trickier, I'd say leave as.

  • LuaUI\Widgets\unit_group_move.lua 29 if selUnits.n > 1 then
    if #selUnits > 1 then

  • LuaUI\Widgets\unit_healthbars.lua 202 for i=1,ud.weapons.n do
    for i=1,#ud.weapons do

  • LuaUI\Widgets\unit_rangerings.lua 67 selUnits.n = nil -- So our loop works
    Remove that line. Below, change pairs into ipairs


Top
 Offline Profile  
 
PostPosted: 06 Jul 2011, 22:18 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
Thank you Z, I very much appreciate it. But I can't help but wonder, how would I have ever fixed that by myself? Pairs? Ipairs? Ipods? Wut?

Just because I can hack away at gadgets and add all kinds of stuff and make them do what I want, doesn't mean I all of a sudden understand the inner workings of lua.

Also, sorry about the comment being left in there, that was an export of results from baregrep.


Top
 Offline Profile  
 
PostPosted: 06 Jul 2011, 22:28 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
Forboding Angel wrote:
that was an export of results from baregrep.
Notepad++. Search in files. .n Whole word.


Top
 Offline Profile  
 
PostPosted: 06 Jul 2011, 22:44 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
zwzsg wrote:
When they said Windows was backward compatible, then didn't mean every single DOS games had to be remade to work under Windows.

thing is, nobody said the new spring version would be backwards compatible. in fact, the opposite is implied by the fact that this (and more importantly the other) thread was created.


Top
 Offline Profile  
 
PostPosted: 06 Jul 2011, 23:18 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
nice, but ...

zwzsg wrote:
LuraRules\draw.lua 6 if (not arg) then arg = {...}; arg.n = #arg end
WTF is this if select == nil ?? Doesn't make any sense! I'd say delete it, and see if anything breaks.
Bad idea, just keep as is.

zwzsg wrote:
LuaUI\Widgets\gui_chiliselections.lua 896 selectedUnitsByDef.n = nil
Remove that line, and below, change:
or i,v in pairs(selectedUnitsByDef)
into:
or i,v in ipairs(selectedUnitsByDef)
Again no change required.


Top
 Offline Profile  
 
PostPosted: 08 Jul 2011, 02:06 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
On the subject of being a broken record...

I read somewhere in this thread to look for [n] as well. What about these?

*snipped*


Last edited by Forboding Angel on 08 Jul 2011, 02:29, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 08 Jul 2011, 02:20 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
Forboding Angel wrote:
On the subject of being a broken record...

I read somewhere in this thread to look for [n] as well. What about these?
Totally unrelated.


Top
 Offline Profile  
 
PostPosted: 08 Jul 2011, 02:29 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: You are going to die anyway, hurry up and do it.
are you getting errors about them? if so look into it. if not it is fine and unrelated.


Top
 Offline Profile  
 
PostPosted: 08 Jul 2011, 02:33 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring since 04/24/12
Nope, not that I can tell. Seems to work ok. Groupmove still isn't working right, but that's fairly minor I think.

So many bugs :-/

or wait, oh I'm prolly testing with an old as 83 (it';s what abma told me to use to test this .n stuff). That would explain a heck of a lot.

Also, on some of my beam weapon emits a random ceg is being fired :-/ Maybe it has a hit ceg defined... looking... Yep, it does. So ok, that's a game bug then (technically it's an engine bug tho because only the glow is emitted, the beam is never actually fired, but, semantics... Easy enough to fix on my end.

I despise mantis... Can I post bugs elsewhere? (Like help and bugs forum?)


Top
 Offline Profile  
 
PostPosted: 08 Jul 2011, 02:41 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
if at all you should need to look for ["n"]. but it's such a strange syntax, so I don't think anyone ever used it in a dangerous way.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.