Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
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
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 533 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 17 of 32 1 2 15 16 17 18 19 31 32
Re: C# wrapper - A7.80 V1.0.1 [Re: Stromausfall] #284970
08/16/09 11:26
08/16/09 11:26
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Hmm, I tried this and it doesn't seem to be working... Am I just missing something simple, or does vec_to_angle not work?

Code:
EngFun.vec_set(EngVar.target,player.xyz);
EngFun.vec_sub(EngVar.target,EngVar.camera.xyz);
EngFun.vec_to_angle(EngVar.camera.panTiltRoll,EngVar.target);



It's version 1.1.1.4 for A7.77, haven't updated to A7.80 yet.

Re: C# wrapper - A7.80 V1.0.1 [Re: Claus_N] #284971
08/16/09 11:36
08/16/09 11:36
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
this seems to be the bug with getValueFrom which affects some functions (i think that this one is also affected)
I uploaded version 1.1.1.6 for A7.77, try this version of the wrapper it should fix your problem i think ! (as i prior to your post only fixed this problem in the wrapper for A7.80 and A6.60)

Last edited by Stromausfall; 08/16/09 11:37.

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 - A7.80 V1.0.1 [Re: Stromausfall] #284975
08/16/09 12:07
08/16/09 12:07
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Thanks, it's working now wink

Re: C# wrapper - A7.80 V1.0.1 [Re: Claus_N] #284993
08/16/09 14:30
08/16/09 14:30
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
E
Enduriel Offline
Member
Enduriel  Offline
Member
E

Joined: Aug 2008
Posts: 133
Sweden, Stockholm
hmm, just curious. Making a wrapper means like making all the function prototypes and stuff that comes with the acknex header files if I understand it correct? Not that I know C#, I just wonder it laugh

Re: C# wrapper - A7.80 V1.0.1 [Re: Enduriel] #285025
08/16/09 17:23
08/16/09 17:23
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
yes, i think one could explain wrapper in this way ^^


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
C# wrapper - A7.80 V1.0.2 [Re: Stromausfall] #285037
08/16/09 18:32
08/16/09 18:32
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
I have just released

Version 1.0.2 for A6.60
Version 1.1.1.7 for A.77
Version 1.0.2 for A7.80


these new versions now support implicit casting.
this means that one doesn't need to type
Code:
int x = EngFun.clamp((Var)3, (Var)4, (Var)5).IntValue;


anymore (although this is still supported), but now one can type :
Code:
int x = EngFun.clamp(3, 4, 5);


thus explicit casting isn't needed anymore (although it's supported)

BUT one doesn't forget that if one writes
Code:
Var TempVar = new Var(3);
TempVar = 4;


then not the value of the TempVar object is changed, but a new object is created that has the value 4 ! Thus Var.IntValue and Var.FloatValue aren't obsolete and are still needed and useful ! For example if you want to change the position of an Entity :
Code:
ENTITY Dummy = EngFun.ent_create("dummy.mdl", new Vector(0, 0, 0), null);
MySky.z.IntValue += 30;



That's why you should use implicit casting with care, as it ALWAYS creates a new object and DOESN'T modify the existing object !

Another thing that i need to mention is that if one writes :
Code:
Var xxx = null;
int z = xxx;


normally implicit casting would fail here, that's why null is casted to 0 (like in lite-c). That means that the code above will result in :
Code:
z = 0



And as already mentioned, one can still only use explicit casting like with the previous versions!

Last edited by Stromausfall; 08/17/09 06:29.

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 - A7.80 V1.0.2 [Re: Stromausfall] #285842
08/20/09 16:04
08/20/09 16:04
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
I'm trying to convert this lite-c snippet i wrote to C# but i can't seem to get it to work...

(Lite-C) "Both executed in the main function"
Code:
BMAP* arrow = "arrow.pcx";
mouse_map = arrow;
mouse_mode = 2;
int snap_amount = 30;
double ux = 0.0;
double uy = 0.0;

while (1) // move it over the screen
{  
ux = mouse_cursor.x / snap_amount;
uy = mouse_cursor.y / snap_amount;
		
mouse_pos.x = (integer(ux)*snap_amount);
mouse_pos.y = (integer(uy)*snap_amount);
wait(1);
}


(Wrapper attempt)
Code:
BMAP* arrow = EngFun.bmap_create("arrow.pcx");
EngVar.mouse_map = arrow;
EngVar.mouse_mode.IntValue = 2;
int snap_amount = 30;
double ux = 0.0;
double uy = 0.0;

while(true)
{
ux = (EngVar.mouse_cursor.x.FloatValue / snap_amount);
uy = (EngVar.mouse_cursor.y.FloatValue / snap_amount);

EngVar.mouse_pos.x.IntValue = (EngFun.integer((Var)ux).IntValue * snap_amount);
EngVar.mouse_pos.y.IntValue = (EngFun.integer((Var)uy).IntValue * snap_amount);
yeild return 1;
}



Thanks.

Last edited by DJBMASTER; 08/20/09 16:15.
Re: C# wrapper - A7.80 V1.0.2 [Re: DJBMASTER] #285868
08/20/09 21:02
08/20/09 21:02
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
Hi !

It seems that i only had to change BMAP* to BMAP to get this code snippet to work!

Code:
BMAP arrow = EngFun.bmap_create("arrow.pcx");
EngVar.mouse_map = arrow;
EngVar.mouse_mode.IntValue = 2;
int snap_amount = 30;
double ux = 0.0;
double uy = 0.0;

while(true)
{
ux = (EngVar.mouse_cursor.x.FloatValue / snap_amount);
uy = (EngVar.mouse_cursor.y.FloatValue / snap_amount);

EngVar.mouse_pos.x.IntValue = (EngFun.integer((Var)ux).IntValue * snap_amount);
EngVar.mouse_pos.y.IntValue = (EngFun.integer((Var)uy).IntValue * snap_amount);
yield return 1;
}



Last edited by Stromausfall; 08/20/09 21:04. Reason: ups forgot to change ^^

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 - A7.80 V1.0.2 [Re: Stromausfall] #285869
08/20/09 21:25
08/20/09 21:25
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
hmmm thats strange, i must of changed part of my code as i typed the post because BMAP* wont even compile in C#,so it was a typo LOL. Guess i fixed my code while posting it, ahahahaha. Thanks anyway.

Re: C# wrapper - A7.80 V1.0.2 [Re: DJBMASTER] #285870
08/20/09 21:29
08/20/09 21:29
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
LoL ^^


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
Page 17 of 32 1 2 15 16 17 18 19 31 32

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