Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (EternallyCurious, AndrewAMD, TipmyPip, Quad), 889 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 14 of 23 1 2 12 13 14 15 16 22 23
C# wrapper 2.3.0 - RELEASE [Re: pararealist] #376311
07/01/11 16:37
07/01/11 16:37
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
a new version was uploaded (for Acknex 7.85.4 AND Acknex 8.20)
the update of the wrapper includes:

- updated to 8.20
- the wrapper can be used without the scheduler - using the Conditional compilation symbols (VS2010) value "NO_SCHEDULER" ("A7_WRAPPER" can be used beside "NO_SCHEDULER" !)

here's the link:

AcknexWrapper_2_3_0_FOR_8_20_AND_7_85_4.zip

when using the wrapper without the scheduler, references to used delegates have to be stored ! Additionally WrappedDouble, WrappedInt and WrappedString objects are introduced, they have to be used in order to interact with certain methods like pan_setneedle etc... These objects are needed, because WITHOUT a scheduler, the creation/deletion and updating of such variables isn't done automatically ! Additionally no more IEnumerables have to be used, if the scheduler isn't used !

here's an example, providing an overview on how to use the wrapper wihtout a scheduler and how the WrappedDouble is used :

Click to reveal..

Code:
using AcknexWrapper;

namespace NoSchedulerTest
{
    public class Program
    {
        static void Main(string[] args)
        {
            // opening the engine
            EngFun.engine_open(null, null);

            // limit frame rate
            EngVar.fps_max = 60;

            // load an empty level
            EngFun.level_load(null);

            // create a player entity
            Player player =
                new Player(new Vector(100, 0, 0));

            // create and keep the reference to the delegate as long as it is needed !
            WrapperDelegateVoid onSpaceMethodDelegate =
                OnSpaceMethod;

            // assign the delegate to the EngVar variable
            EngVar.on_space =
                onSpaceMethodDelegate;

            // create a panel
            PANEL sliderPanel =
                PANEL.pan_create(null, 1);
            sliderPanel.SHOW = true;
            sliderPanel.size_x = 300;
            sliderPanel.size_y = 100;
            
            // allow mouse interaction
            EngVar.mouse_mode = 4;

            // create bitmaps, to be used in the slider
            BMAP sliderBackground =
                BMAP.bmap_createblack(200, 40, 24);
            BMAP sliderKnob =
                BMAP.bmap_createblack(20, 60, 24);
            sliderBackground.bmap_fill(new Color(255, 255, 255), 100);

            // the value to be read and modified by the user AND the engine
            WrappedDouble wrappedDouble =
                new WrappedDouble(50);

            // create the slider
            sliderPanel.pan_setslider(
                0,
                50,
                50,
                sliderBackground,
                sliderKnob,
                0,
                255,
                wrappedDouble);

            bool keyEnterHasBeenReleased = true;

            while (EngFun.engine_frame() != 0)
            {
                // interaction in the rendering loop
                if (EngVar.key_enter == true)
                {
                    if (keyEnterHasBeenReleased == true)
                    {
                        EngVar.sky_color.blue += 25;
                        EngVar.sky_color.blue %= 255;
                        keyEnterHasBeenReleased = false;
                    }
                }
                else
                {
                    keyEnterHasBeenReleased = true;
                }

                EngVar.sky_color.red = wrappedDouble.Value;
            }

            EngFun.engine_close();
        }

        // interaction using EngVar key events
        private static void OnSpaceMethod()
        {
            EngVar.sky_color.green += 25;
            EngVar.sky_color.green %= 255;
        }
    }

    public class Player
    {
        private readonly ENTITY PlayerEntity;

        /// <summary>
        /// the delegate has to be referenced to, as long as it is used !
        /// </summary>
        private readonly WrapperDelegateVoid PlayerRoutineDelegate;

        public Player(Vector position)
        {
            // create the entity
            this.PlayerEntity =
                ENTITY.ent_create("_CUBE.MDL", new Vector(100, 0, 0), null);

            // enable triggering of the event function, every frame !
            this.PlayerEntity.ENABLE_FRAME = true;

            // create and store the delegate
            this.PlayerRoutineDelegate =
                this.PlayerRoutine;

            // assign the event method/delegate
            this.PlayerEntity.event_ =
                this.PlayerRoutineDelegate;
        }

        // interaction using on_frame
        private void PlayerRoutine()
        {
            double speedOfPositionChange =
                2.5 * EngVar.time_step;

            if (EngVar.key_a == true)
            {
                this.PlayerEntity.y += speedOfPositionChange;
            }
            if (EngVar.key_d == true)
            {
                this.PlayerEntity.y -= speedOfPositionChange;
            }
            if (EngVar.key_w == true)
            {
                this.PlayerEntity.z += speedOfPositionChange;
            }
            if (EngVar.key_s == true)
            {
                this.PlayerEntity.z -= speedOfPositionChange;
            }
        }
    }
}





get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper 2.3.0 - RELEASE [Re: Stromausfall] #376317
07/01/11 18:14
07/01/11 18:14
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,

Thanks for the update, I'll grab it right now!

Best regards.

Re: C# wrapper 2.3.0 - RELEASE [Re: 3dgs_snake] #376373
07/02/11 10:38
07/02/11 10:38
Joined: Feb 2005
Posts: 3,687
Hessen, Germany
T
Tempelbauer Offline
Expert
Tempelbauer  Offline
Expert
T

Joined: Feb 2005
Posts: 3,687
Hessen, Germany
Dein Wrapper ist immer Top-aktuell. Das ist auch wichtig für jeden der ihn einsetzt. Gibt andere Engines, da wird ein solches Projekt gestartet, nach einigen Monaten wieder fallen gelassen und dessen Nutzer sitzen dann auf dem Trockenen

Vielen Dank für den kontinuierlichen Einsatz und die regelmäßigen Updates laugh
Beteiligt sich Conitec eigentlich mittlerweile an der Entwicklung (sei es mit Manpower oder mit anderweitigen Entlohnungen)? Ein solcher Wrapper ist ja auch eines derer Interessen...

Re: C# wrapper 2.3.0 - RELEASE [Re: Tempelbauer] #376375
07/02/11 11:33
07/02/11 11:33
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
jo danke ^^ ist wahrscheinlich deshalb aktuell, weil ich ihn ja selber auch benutze ^^
Und von Conitec hab ich auch eine Entlohnung bekommen ^^


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper 2.3.0 - RELEASE [Re: Stromausfall] #376720
07/06/11 05:33
07/06/11 05:33
Joined: Mar 2009
Posts: 42
Dominican Republic
keilyn3d Offline
Newbie
keilyn3d  Offline
Newbie

Joined: Mar 2009
Posts: 42
Dominican Republic
Stromausfall Thanks for make this awesome wrapper, this was the best thing that could be happen to 3dgamestudio...

I had a software created with 3dgamestudio/winapi, but the application only worked in "windows 7", but with this wrapper I have port the app to .net/winform easily and now it work in any windows system...

The power of acknex + .net is amazing

Thank you very much!!! you are the best!!

Re: C# wrapper 2.3.0 - RELEASE [Re: keilyn3d] #376748
07/06/11 12:02
07/06/11 12:02
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
Thanks ^^


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper 2.3.1 - RELEASE [Re: Stromausfall] #376981
07/08/11 12:28
07/08/11 12:28
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
a new version was uploaded (for Acknex 7.85.4 AND Acknex 8.10)
the update of the wrapper includes:

this update includes:
- missing PhysX functions included : pXent_rotate, pXent_setbodyflag, pXent_setbodyflagall (thanks to pararealist !)

here's the link:

AcknexWrapper_2_3_1_FOR_8_20_AND_7_85_4.zip


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper 2.3.1 - RELEASE [Re: Stromausfall] #379281
07/31/11 17:01
07/31/11 17:01
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Hey!
I have to say again: Great Work!
But would it be possible to create a fluent interface for the vector things??
Because coding would be much easier then:
Code:
Old way:
Vector direction = new Vector(activeCCharacter.Position);
direction.vec_sub(EngVar.target);
direction.vec_normalize(5);

New Way:
Vector direction = new Vector(activeCCharacter.Position).vec_sub(EngVar.target).vec_normalize(5);



Sure it's not to hard to implement this. Afak the only thing to change is the return type of those vector functions....

Another thing, but i think it's too late for that:
We have object orientation so we can't simply call the function create of a BMAP with an ENTITY. My thought is:
Why to use those prefixes??

This would be much nicer:
ENTITY myEnt = ENTITY.create("pla",pla,pla);
Or even better:
ENTITY myEnt = new ENTITY("pla",pla,pla);

Would be cool to see this.

Greetz Felix


Visit my site: www.masterq32.de
Re: C# wrapper 2.3.1 - RELEASE [Re: MasterQ32] #379296
07/31/11 21:30
07/31/11 21:30
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
i try to keep as close to lite-c as possible !
the return values of functions aren't always that obvious !

I also chose static constructors, because then you know WHICH function is used to create the entity (as there are several available, like ent_createlayer etc...)

thus in short, looking at the code, it should be easy to see which acknex function is called/used, this isn't as obvious anymore if the name is changed (for example through a constructor, or changing vec_add to add or even overload the + operator...)


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper 2.3.1 - RELEASE [Re: Stromausfall] #379440
08/02/11 15:10
08/02/11 15:10
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
pararealist Offline
Senior Member
pararealist  Offline
Senior Member

Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
I agree with Stromausfall.

With those changes the wrapper will have a higher learn curve, where as now if you know lite-c, the wrapper is no problem, and it is an acknexwrapper after all.


A8.3x Commercial, AcknexWrapper and VS 2010 Express
&#9675;pararealist now.
Page 14 of 23 1 2 12 13 14 15 16 22 23

Moderated by  TWO 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1