calling functions via a name variable?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

chip

New Member
Nov 14, 2002
524
0
0
Visit site
i've just started prototyping a system that i hope will allow switching portions of a character's mesh via scripting, events, etc., so characters can re-configure their appearance during a game. i plan to use AnimNotifies extensively, but have a question about calling a UScript function in this manner.

the UDN info describes the AnimNotify_Script as able to call a UScript function, and lists the variable NotifyName as type Name for use in this Notify. in this case, would the name of a function to call via AnimNotify_Script be a fully-qualified name like MyModuleDriver.EnableModuleAnims(parametertype parameter1)?

sorry if this seems rudimentary, but i've never considered what "data type" a function call is.
 

Aegeri

Mad Microbiologist, of ASSHATTERY
Mar 15, 2004
514
0
0
40
New Zealand
No, from what I know about AnimNotifies is that it only will call the function of a script that the mesh is associated with, thus you must have the function present in the script where your mesh is being used else it won't work. Look at xPawn and you'll see what I mean.

Also I think the functions are done the same way the INI files do it, in that to parse paramaters you just do Fire 1, and not Fire(1).

Reply by [SAS]Solid Snake
 

Kamek

Magikoopa
Sep 26, 2004
10
0
0
bastard.popexperiment.com
Could you try making it an exec function, and then calling it with ConsoleCommand()?

such as

Code:
exec function SomeFunction(some parameter)
{
  log("Blah blah");
}

function SomeOtherFunction(string FunctionINeedToCall)
{
  Self.ConsoleCommand(FunctionINeedToCall);
  log("I done called" @ FunctionINeedToCall @ "lol!");
}

Or would that not work?
 

chip

New Member
Nov 14, 2002
524
0
0
Visit site
Aegeri said:
... it only will call the function of a script that the mesh is associated with, thus you must have the function present in the script where your mesh is being used ...
many thanks -- i'll post how it works out (IF it does :D )
 

BinarySystem

Banned
Jun 10, 2004
705
0
0
Kamek said:
Could you try making it an exec function, and then calling it with ConsoleCommand()?

such as

Code:
exec function SomeFunction(some parameter)
{
  log("Blah blah");
}

function SomeOtherFunction(string FunctionINeedToCall)
{
  Self.ConsoleCommand(FunctionINeedToCall);
  log("I done called" @ FunctionINeedToCall @ "lol!");
}

Or would that not work?

Wow, that's.. err.. really clever actually. There's limits on where exec functions can reside, but still a clever idea. Performance would probrably be less than desireable but for triggers and stuff it wouldn't really be an issue.
 

chip

New Member
Nov 14, 2002
524
0
0
Visit site
Aegeri/[SAS]Solid Snake:

you were spot on, thanks for the info. i now have an xPawn subclass that is composed of "graphic" skeletal mesh modules (dynamically switchable, i hope) attached to an invisible "control" skeleton. The AnimNotifies of the control rig tell the modules how and when to animate. works a treat so far, though the coding for the module switching has just begun.
 

Dash489

New Member
May 13, 2004
38
0
0
chip said:
you were spot on, thanks for the info. i now have an xPawn subclass that is composed of "graphic" skeletal mesh modules (dynamically switchable, i hope) attached to an invisible "control" skeleton. The AnimNotifies of the control rig tell the modules how and when to animate. works a treat so far, though the coding for the module switching has just begun.

Hey thats kinda of a neat idea on doing dynamic modular meshs. I actually was trying to to come up with a similar system and I didn't come up with a way to tell the modules to animated. I didn't think to use Anim_Notifies, the only draw back would be that you would need to put a lot of Notifies for all the different modules and different ones for every specific animation I would think. Anyway, good luck with the system. Let me know how it turns out. By the way what kind of mod are you working on?
 
Last edited:

chip

New Member
Nov 14, 2002
524
0
0
Visit site
for the protoype, i've added a single AnimNotify_Script to each anim sequence of a character that is essentially a simplified HumanFemale model.

i created the modules in MayaPLE, using a MEL script that builds the various skeletons (really speeds things up), and using exports of the geometry from MilkShape to .dxf format for importing into Maya5 PLE.

a single function in my xPawn subclass sets the modules' animation parameters -- i have four modules at present (head, torso, arms and legs) but that can be expanded as needed.

so far i've tested the anim sequence switching via the AnimNotify_Script and it works as expected (though i have a few karma tweaks to incorporate). i'm just about to test the actual module switching.

i haven't yet made this a playable pawn -- that'll have to wait 'til the basic concepts are proven with a placed pawn.

i'm not actuallly working on a specific mod -- just trying to develop some new capabilities for the community.
 

BinarySystem

Banned
Jun 10, 2004
705
0
0
True, but probrably very easily pluggable - you could have a default property used to enable or disable those functions so before calling the function through script you would set class'Whatever'.default.bAllowExec to true, say, and your exec functions would check that value, and if it was false, would return immediately. If it was true they might reset it to false and proceed with their functionality.