For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Some Native coding questions

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
Chaos13
OldUnreal Member
Posts: 951
Joined: Sat Feb 16, 2008 10:24 am

Some Native coding questions

Post by Chaos13 »

1. How you can create a iterator (to iterate throught all vertexes in level for example) and make it work like

Code: Select all

ForEach AllVertexes(Level,V)
Draw3DDot(V);
It says that function must be native but i dunno how to make the engine to force *iteration*.

2. How can you return out parameters from native script?
Last edited by Chaos13 on Wed Feb 20, 2008 7:34 pm, edited 1 time in total.
Skydev = Chaos13 = Dimension4
User avatar
[]KAOS[]Casey
OldUnreal Member
Posts: 4497
Joined: Sun Aug 07, 2011 4:22 am
Location: over there

Re: Some Native coding questions

Post by []KAOS[]Casey »

1: no idea.
2:

All i know is you put a & next to the variable in the function header in c++
User avatar
Chaos13
OldUnreal Member
Posts: 951
Joined: Sat Feb 16, 2008 10:24 am

Re: Some Native coding questions

Post by Chaos13 »

1: no idea.
2:

All i know is you put a & next to the variable in the function header in c++
Well your wrong cause it uses special FFrame& Stack to get variables and it gets vars using predefined P_GET_* macros.

Function header is

Code: Select all

void A::exec (FFrame& Stack, RESULT_DECL)
so there is nothing to put & after ...
for example:

Code: Select all

void 
ADNRoot::execReadFile (FFrame& Stack, RESULT_DECL)
{
      //FString* FName;
      FString ReadHere;
      guard (ADNRoot::execReadFile);
      P_GET_STR(FName);
      P_FINISH;
      appLoadFileToString(ReadHere,*FName);
      *(FString*)Result=*ReadHere;
      unguardexec;
}
Any ideas?
Last edited by Chaos13 on Thu Feb 21, 2008 9:54 pm, edited 1 time in total.
Skydev = Chaos13 = Dimension4
User avatar
[]KAOS[]Casey
OldUnreal Member
Posts: 4497
Joined: Sun Aug 07, 2011 4:22 am
Location: over there

Re: Some Native coding questions

Post by []KAOS[]Casey »

Not at all. have no real interest in native coding if/when we get 227 headers.
User avatar
Raven
OldUnreal Member
Posts: 311
Joined: Fri Jun 10, 2005 5:10 am

Re: Some Native coding questions

Post by Raven »

1) No idea, but why would you want it anyway in UScript (i mean this AllVertexes iterator)? Beside it'd be resources consuming, I think that all that stuff should be implemented in C++ only. Unreal Script is really slow :).

2) No idea, try to find some examples in public headers. I think it's just like in UScript. You have to read variable (through P_GET mecors) and then assign a value to it. All that P_GET macros are described somewhere in the headers.
Image
User avatar
Bane
OldUnreal Member
Posts: 493
Joined: Sun Mar 03, 2002 6:32 pm

Re: Some Native coding questions

Post by Bane »

2)

from http://www.esconline.org/Resources/native.html

Code: Select all

P_GET_ARRAY_REF, P_GET_STR_REF, etc. - used in the exact same way as the P_GET* macros (not the optional macros), and allows parameters to be paseed by reference. For example: 

native function Foo( out int x, out int y ); 
void MyClass::execFoo( FFrame &Stack, void const *Result )
{ 
     guard( MyClass::execFoo ); 
     P_GET_INT_REF( x ); 
     P_GET_INT_REF( x ); 
     P_FINISH; 

     // Do what we want. 

     unguard; 
}
This should work, unless the guy who wrote it likes to make up Macros. No guarantee on anything from that page, I tried the native tutorial and couldn't get it to work.
Author of Hide and Seek mod, and the NALIBALL mod

Hide and Seek can be downloaded from:
http://HideNSeek.5u.com
User avatar
Chaos13
OldUnreal Member
Posts: 951
Joined: Sat Feb 16, 2008 10:24 am

Re: Some Native coding questions

Post by Chaos13 »

References*! Thats what i need! ~THANKS!~

-Dim4

P.S: That code is corrupted cause it grabs from stack 2 variables and saves them into same variable (x) so "out int x" will be NEVER read, only "out int y" will be ^_^

I found out some macroses related to Iterators *very happy* :D^_^ [smiley=happy.gif]
Last edited by Chaos13 on Fri Feb 22, 2008 8:29 pm, edited 1 time in total.
Skydev = Chaos13 = Dimension4
User avatar
Chaos13
OldUnreal Member
Posts: 951
Joined: Sat Feb 16, 2008 10:24 am

Re: Some Native coding questions

Post by Chaos13 »

Not at all. have no real interest in native coding if/when we get 227 headers.
Till 227 is 100% ready i prefer to stay at Gold for following reasons:
1. Its more stable
2. It has native headers !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3. Its final version

By the way native coding gives you REAL power like window creating, accessing native globals, realtime editing, debugging, (Take a look at http://www.oldunreal.com/cgi-bin/yabb2/YaBB.pl?num=1203535382/0#10) - i used that to implement EditObject in my console 8-)
Last edited by Chaos13 on Fri Feb 22, 2008 7:15 pm, edited 1 time in total.
Skydev = Chaos13 = Dimension4
User avatar
Chaos13
OldUnreal Member
Posts: 951
Joined: Sat Feb 16, 2008 10:24 am

Re: Some Native coding questions

Post by Chaos13 »

I found out all answers i asked in this thread... please someone lock it!
Skydev = Chaos13 = Dimension4

Return to “UScript Board”