PDA

View Full Version : Exec functions



Jrubzjeknf
12-12-2007, 04:23 AM
The following is stated on the UDN:


Exec

Indicates that this function can be executed by typing the name of the function into the console. Only valid in certain classes.

What are these certain classes exactly? I tried using Interaction, but appearantly that doesn't work any more.

I'd really like to know which classes can have exec functions, so I can make a proper design decision.

Eliot
12-12-2007, 04:28 AM
http://wiki.beyondunreal.com/wiki/Exec_Function

scroll down.

BattleMode
12-12-2007, 05:06 AM
http://wiki.beyondunreal.com/wiki/Exec_Function scroll down. If I do that I find "Note: this is only for UT2003/4". Where did you find the info for UT3?

Perhaps a grep for "function exec" will tell us which classes allow exec.

Bonehed316
12-12-2007, 12:00 PM
Its (mostly) classes owned by the player. Pawn, HUD, Controller, Weapon, etc.

Jrubzjeknf
12-12-2007, 12:29 PM
Yes, I just tried something else.

Appearantly, Interaction classes don't support exec functions any more. HUD classes only can use exec functions when they're the main HUD class, ie the one referred to in PlayerController.myHUD.

According to the list on unrealwiki, that leaves me with:

the Console interaction (See interaction)
the GameInfo actor (Server only)
the local player's HUD actor (Works for a single object only)
the local player's CheatManager (Offline only)
the local player's AdminManager (Admin only)
the local PlayerController (Replacing breaks network compatibility)
the local player's PlayerInput (See Interaction)
the local player's Pawn (Replacing breaks network compatibility)
that Pawn's selected Weapon and SelectedItem (Only works for the selected item)
any local Interaction (Not possible any more)

NOTHING.

Eliot
12-12-2007, 01:07 PM
you could try inventory, i don't think in ut3 you need it to have selected if its just an inventory subclass like jumpboots, but maybe exec isn't supported on inventorys either.

Pfhoenix
12-12-2007, 01:55 PM
Nope, Inventory class doesn't support execs. Feel free to try various Inventory subclasses, though.

Bonehed316
12-12-2007, 10:00 PM
Are you sure? I would think that Inventory subclasses are supported when they're in a local player's inventory (and are thus owned by the player). I know weapon is, and that's an inventory, but it might just be special.

sinx
12-23-2007, 06:49 AM
Jrubzjeknf, did you have any luck with exec functions? I'm just looking at them now and have come across the same problem you did regarding classes. Interactions are pretty much nerfed in UT3.

Jrubzjeknf
12-23-2007, 08:04 AM
No, nor I got any response on the mailing list.

Bob_Gneu
01-19-2008, 01:16 AM
So if i want to add an exec function i should be doing so to one of the entries here?



the Console interaction (See interaction)
the GameInfo actor (Server only)
the local player's HUD actor (Works for a single object only)
the local player's CheatManager (Offline only)
the local player's AdminManager (Admin only)
the local PlayerController (Replacing breaks network compatibility)
the local player's PlayerInput (See Interaction)
the local player's Pawn (Replacing breaks network compatibility)
that Pawn's selected Weapon and SelectedItem (Only works for the selected item)
any local Interaction (Not possible any more)

I want to allow admins the ability to update the mutator on the fly or single players to tweak the values to their liking. Any thoughts?

sinx
01-19-2008, 02:10 AM
I think the only real option at this stage is the "mutate" exec command for mutators because as you indicate, there's not much we can do to safely incorporate a class that allows exec functions. Client-side Interactions used to be the best way but of course, as we all know, they are not anywhere near the thing they used to be.

I guess it's not a game killer but just a real pain. Personally, I don't like the idea of having to prefix everything like >"mutate mymod mycommand" simply because the "mymod" string should be enough. For small mutators it's not really an issue but for mutators containing lots of commands, it gets annoying real fast - particularly with commands where it is not appropriate to bind them to a key.

Bob_Gneu
01-19-2008, 02:14 AM
Oh jeeze, i didnt even see that. So i can write the Mutate function into my mutator and have it execute commands, in a switch or whatever. This is definitely what i was looking for. Its not as simple as declaring a single exec function but its definitely better than nothing.

You can bind the mutate xyz variableshere to a key. At least thats what the documentation is saying...

Inside GameInfo.uc

/* Mutate()
Pass an input string to the mutator list. Used by PlayerController.Mutate(), intended to
allow mutators to have input exec functions (by binding mutate xxx to keys)

Bob_Gneu
01-19-2008, 02:24 AM
I just tested this out and apparently you don't have to work quite that hard.

If you dont bother with worrying about clobbering other peoples mutators options, you can just use mutate something and it gets passed through all mutators Mutate functions. You can parse for any text you wish.

Blade[UG]
01-19-2008, 08:54 AM
and as long as you pass it on to the rest of the mutators, you can even have one mutate command operate several, if it came down to it ;)

replacing pawn and playercontroller breaks network compatibility? wha? Do you mean breaks compatibility with TC type things?

A search of the base code reveals...
Admin, Controller, CheatManager, Console, GameInfo, somewhere along the UIScene tree (probably the whole thing), GameViewportClient, HUD, InventoryManager, PlayerInput.. basically anything that belongs to a player .. although i don't see it used anywhere in Inventory/Weapon which is typically something that belongs to a player.. so not quite everything, presuming that you can't use it there since Epic didn't.

Mutators offer the Mutate command, TCs could use others. Doesn't sound terribly difficult

Bob_Gneu
01-19-2008, 01:31 PM
id like to add that my mutator with the info did not allow me to use the exec functions.

You guys can check a working method of parsing out from the MutatorString on my SVN, but i ran into a bit of an issue where if i edit it on a client, which shouldnt be allowed, it updates the server and all that and then crashes. My replication is only in the info class which as i mentioned above has no exec/mutate capacity. So why am i able to change values? is this an admin situation? If i start a server with my id/pw and i log into it does that make me admin immediately?


The crash seems to have been related to something else. I woke up this morning and dropped logs into it and i get no crashes now. The only catch is that the values are being changed on the server and not propagating now. I think this is due to my replication block now. Ill be back when i figure it out.


The variables werent set to repnotify. All is well now. View my fix/code (http://svn2.assembla.com/svn/gneut3/Src/JumpMod/Classes/) here.

Jrubzjeknf
01-19-2008, 05:07 PM
I am aware of the Mutate() function in the Mutator class, but I made this thread to address the lack of being able to use exec functions for mutators.

The advantages of using an exec function over Mutate():
Clientside functionality is kept on the client - Mutate() is handled on the server.
Exec functions can take all kind of data types, while Mutate() can only accept one string.


;25241526']replacing pawn and playercontroller breaks network compatibility? wha? Do you mean breaks compatibility with TC type things?

With that, I meant the method stops working after one iteration. Imagine what happens if I use this method, and someone else does the same.

Blade[UG]
01-19-2008, 07:11 PM
I see that Input has an exec in it, and appears to be pretty much just an Interaction with a couple of added thingees. Perhaps that could be used?

immortius
01-20-2008, 12:23 AM
Perhaps, but I don't think that exec does anything until the subclass PlayerInput (which gets it's exec ability from being combined with PlayerController). But that is just a guess, so feel free to test it.

Bob_Gneu
01-20-2008, 12:28 AM
What types of data are you expecting to put into the command line?