• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Program Entry Point

Sent666

Grizzled Veteran
Jun 25, 2006
72
0
This is my first scripting language I ever worked with and I'm not sure if it's similar to C++ where a program has a specific entry point. For example, in a C++ console app, the entry point is int main(), and in Windows API it's Winmain. So does Unreal Script have an entry point of where the program will start? Here is my guess: I make a mutator for example, I have a number of files that modify the weapons in some way. Then I have a sort of "main" file where everything comes together. This class extends the mutator modifier, am I correct in saying when I run the mutator it will start in the class with the mutator modifier?
 
no :p

its a little more difficult. The game runs and, like you said has its entry point somewhere, the main of the ucc.exe.

Now there is the interface of UScript. Somewhere in the binary (native code), or already in the UScript sources, there is some call that checks for all mutators that are enabled on the server and spawns them. Then the standard life cycle for an actor is started. Certain functions like for example PreBeginPlay of that actor are called.
I think for the actor life cycle (and other classes in specific) there is a wiki entry.


Disclaimer: this is from the top of my head and considering my rather low knowledge on this subject i could be wrong :)
 
Upvote 0
Hm...I think I asked the wrong question! Let's try again: I am assuming you know some C++. You know when you have multiple .cpp's and such? And when you run it, the program automatically goes to the entry point (int main()). Say I have multiple unreal script files, such as one script that modifies the amount of ammo in the Kar98, and another that modifies ammo for MG42. Would this be sufficent to create a working mutator? Note that these classes will extend from the original main RO source code. I am asking now, do I have to have a sort of "main" script where everything comes "together"? Will any mutator I make have to have a 'main' script where it extends from the Mutator modifier? Thanks! :eek:
 
Upvote 0
i think you have to get away from the C++ thinking of compiling.
With extending a class you add something new to the class tree.

mutator is no modifier, its a class that you subclass.
Its just one "entry point". Tbh. there is nothing like an entry point. You can add vehicles without having a mutator. Just by creating new classes that are subclassed from the correct actors. Those new vehicles would be made playable by putting the actors in a map.

As for mutators, a mutator can be used to modify certain aspects of the game.
But I think im drifting off again.

To your question: Only one file is enough to make a working mutator. The NoSmokeMut is the best example for that.
 
Upvote 0
Technically Commandlets are the closest you have to a Java Public Static void Main() kinda program entry point.. (I don't know how that maps to C++ mind you....)


I'll second Worluk's assesment though (he's deeper into Uscript then I am)..

I recommend checking out the Unreal Wiki's page on UScript:
http://wiki.beyondunreal.com/wiki/UnrealScript
 
Upvote 0