Powered by Invision Power Board

 
  Pages: (14) 1 2 [3] 4 5 ... Last » ( Go to first unread post ) Reply to this topicStart new topicStart Poll

> XLua, MMF2 Extension
United States
Retriever II
Posted: Mar 19 2009, 01:55 AM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


I'm exploring making this object global by nature, with the ability to create different independent lua states in numbered slots. Not only would it be really convenient to access a common lua state in another frame, but it might mitigate some of the problems I've been trying to work out for MB with resetting state.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
United States
Retriever II
Posted: Mar 20 2009, 09:13 PM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


New major XLua release: http://hocuspocus.taloncrossing.com/rii/xlua-global.zip

I've rewritten significant portions of this object to "globalize" it. The lua object itself is now little more than a view, which you can bind to one of many possible independent states. Once bound, any operation is performed on that state. You can also unbind, or rebind the object to a new state. You can also bind multiple XLua objects to the same state, and they will all respond to events.

This object is fully backwards compatible, but you must bind it to a state before you start using it (you don't need to explicitly create the state first, binding to an empty state will create it). If you don't do this, your application will act like there is no XLua object at all -- any operation on an unbound XLua object is essentially ignored.

If you delete a state, any object previously bound to it will be unbound. You can now reset state by deleting the lua state, then rebinding the object to it (thus recreating the state).

Although I haven't really tested this yet, you should be able to access a common lua state from any frame, by binding an XLua object to the same state. As long as it's already been created, it won't be recreated. Delete the state at the end of the frame if you don't want it available elsewhere.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
Denmark
Mecha the Slag
Posted: Mar 21 2009, 06:39 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


so basically

unbind state (<- source of crash)
detroy state 0 (<- also a source of crash)

bind state 0 (<- doesn't crash anything)


??

Because when I do that, it crashes.

This post has been edited by MechaBowser on Mar 21 2009, 06:42 AM


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
United States
Retriever II
Posted: Mar 21 2009, 09:15 PM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


So just to elaborate on this, your application will crash if you try to destroy (or perhaps unbind) a state in an On Function event, if that function was triggered by the same state you're trying to destroy. Control from an On Function event always returns to lua execution, so if the state doesn't exist anymore, bad things happen.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
United States
Retriever II
Posted: Mar 22 2009, 03:06 AM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


http://hocuspocus.taloncrossing.com/rii/xlua-global.zip

Small update to the MMF Interface:

mmf.Keyboard.KeyDown(key)
mmf.Keyboard.KeyUp(key)

These events test current state, if you want to capture the keyup / keydown events themselves, use the WIN Interface.

The key parameter is the numerical value of Microsoft's Virtual-Key Codes, documented here: http://msdn.microsoft.com/en-us/library/dd375731(VS.85).aspx

I recommend creating a table of the keys you care about for convenience and readability.

The documentation is still a bit out of date and doesn't include these functions.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
United States
Xgoff
Posted: Mar 24 2009, 08:25 PM
Quote Post


<):|
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03

Status: (0d) [--]


time to completely rewrite my keyboard code >:(

pretty soon you're going to pop out sound/music functions/variables, aren't you


--------------------

This post may contain original research or unverified claims.
Please disregard the above information and contact an administrator.

DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth:
DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message
DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it
DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep
DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot
this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence
NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above

QUOTE
(5:25:58 PM) Mikau: xgoff
(5:26:00 PM) Mikau: guess what
(5:26:04 PM) Xgoff: chicken butt
(5:26:09 PM) Mikau: **** you
PMEmail PosterUsers WebsiteAOLMSN
Top
Denmark
Mecha the Slag
Posted: Mar 25 2009, 08:13 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


having a load of issues

1) table values and entries aren't reset
2) if alot of functions are callen at once, some of them are politely skipped without reporting any errors


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
United States
Retriever II
Posted: Mar 25 2009, 07:05 PM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


Chances are I won't catch you on MSN for a couple days so could you explain a little better these two issues? What is "a lot" of functions, and which functions are we talking about.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
Denmark
Mecha the Slag
Posted: Mar 26 2009, 01:29 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


Well I've got like 5 particles that spawn at once. They're added to a table and then looped through. When their lifetime variable reaches a certain value they're destroyed. As they're all created at the same time, they're destroyed at the same time, too. However, even though they're all removed from the objects table, sometimes one of them aren't destroyed (which is managed by calling a function to MMF2).


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
United States
Retriever II
Posted: Mar 26 2009, 02:36 AM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


I'd really need to see a code sample, including relevant events, for both creating and destroying these objects. How are you handling object destruction? Fixed ID?

If there were problems with calling lots of events at once, every time I pained a bunch of tiles in a level, they'd be mottled with "holes". But that doesn't happen.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
Denmark
Mecha the Slag
Posted: Mar 26 2009, 08:16 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


Odd.

Yes I'm using fixed values as identifiers for the objects. It's wierd because if I print at the destroy function inside Lua, and add a counter in MMF2 for every destroy function called, they appear different.


Also, I'm having another wierd issue. I have this raycasting going where I check for objects between two points. It's all handled inside MMF2. However, when I tried to do a raycasting, it didn't work. I tried adding a print function in front of it and it suddenly worked. I then tried to comment out the print and it stopped working again. It seems as if some values are 'broken' unless printed. I also have this issue with my require function that I told you about earlier, so it's not a single-case issue.


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
United States
Retriever II
Posted: Mar 27 2009, 02:41 AM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


Small bugfix: http://hocuspocus.taloncrossing.com/rii/xlua-global.zip

mmf.Object.SetLayer only changed the layer of the object's sprite, but not the object itself. This interfered with pasting routines, and probably other stuff as well.

Documentation has also been updated for prior changes.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
United States
Retriever II
Posted: Mar 27 2009, 09:23 PM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


http://hocuspocus.taloncrossing.com/rii/xlua-global.zip Another update

This fixes one of Mecha's bugs, which as a stack bug caused by invoking an MMF Function from a nested "Load String" action. Up until now, "Load File" and "Load String" improperly bypassed the call stack.

There is also a new action, "Invoke MMF Function", which allows calling one of your "On Function" events directly, and works with parameters and return values. It is morally equivilent to a lua function that just calls another MMF Function, and saves a few CPU cycles.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
Denmark
Mecha the Slag
Posted: Mar 29 2009, 05:13 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


Would it be possible to get what line a "on function" is executed at? That would be really useful both for bug-tracking and error reports.

Also a "push Nil return value" would be neat ph34r.gif


edit: after moving away from all dostring activities possible; I am still having troubles with tables not being erased when they should.

This post has been edited by MechaBowser on Mar 29 2009, 05:41 AM


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
Denmark
Mecha the Slag
Posted: Apr 5 2009, 12:46 PM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


hey RII

I don't think xlua likes it when I call a function 300 times at once

I also think that this might be the reason why it've had those errors in the past considering it returns the same error

but yeah, MSN and I can show you proof!

edit: I must warn you, it involves dostring

This post has been edited by MechaBowser on Apr 5 2009, 12:49 PM


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
Denmark
Mecha the Slag
Posted: Apr 7 2009, 09:17 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


I did a few tests on my issues with missing objects.

1) First, I did a test to see if any bugs occoured when not using dostring. I stopped the load map process and instead just plain restarted the level. It worked fine.

2) Second, I took all the lua scripts my map would call and dropped into a lua file. It resulted in a good 320 line lua file, consisting mainly of function calls. I then tried to require the file in my level and not load a map at all, and the same problem occoured as when using dostring. However, I could see that after 220 function calls, the +1/-1 fixed value pattern issue appeared. Everything was fine beforehand. Function # 220 was nothing out of the ordinary, nor were any functions before or after.

The issue could be that I call too many functions at once. All these functions have to communicate with MMF2 one way or another, so I'm probably killing the xlua object somehow. What does bother me, though, is that it doesn't happen before the 220th function.

UPDATE

3) I tried to call every function slowly with a 5 second break inbetween. No difference. Appearently it isn't because I'm calling these functions rapidly, but the issue seem to appear because I call that many by number.

This post has been edited by MechaBowser on Apr 7 2009, 09:21 AM


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
Denmark
Mecha the Slag
Posted: Apr 7 2009, 11:18 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


Yes~!

I have successfully isolated the bug.

RII COME AND GET IT I SAY
I'LL BE WAITING


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
United States
Retriever II
Posted: Apr 7 2009, 09:25 PM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


http://hocuspocus.taloncrossing.com/rii/xlua-global.zip Important bug fix

Pushing or Getting large integers (> ~16.75 million) failed to work properly, because they were being passed by MMF as single-precision floating point. All numeric handling has been switched to integer. This means if you were passing an actual floating point value in either direction, that will no longer work. Push it as a string instead, since MMF and Lua will both handle the conversion with minimal effort or transparently.

A "Push NIL" action has also been added both for MMF and Lua functions.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
United States
Xgoff
Posted: Apr 7 2009, 10:48 PM
Quote Post


<):|
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03

Status: (0d) [--]


QUOTE (Retriever II @ Apr 7 2009, 08:25 PM)
Push it as a string instead, since MMF and Lua will both handle the conversion with minimal effort or transparently.

guaranteed i'll forget about this and make angry posts later when i find i can't push decimals

EDIT: wait how would this work with interface functions that are supposed to take numbers, or does this not apply to interface functions

This post has been edited by Xgoff on Apr 7 2009, 10:54 PM


--------------------

This post may contain original research or unverified claims.
Please disregard the above information and contact an administrator.

DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth:
DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message
DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it
DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep
DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot
this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence
NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above

QUOTE
(5:25:58 PM) Mikau: xgoff
(5:26:00 PM) Mikau: guess what
(5:26:04 PM) Xgoff: chicken butt
(5:26:09 PM) Mikau: **** you
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Retriever II
Posted: Apr 8 2009, 04:09 AM
Quote Post


Catalyst
[H][*][*][*][*]
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 18290
Member No.: 52
Joined: 13-October 03

Status: (0d) [--]


interface functions don't care. Pass what you would expect.


--------------------

PMEmail PosterUsers WebsiteICQAOLMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Pages: (14) 1 2 [3] 4 5 ... Last » Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0833 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 1.57 ]