Transferred from: http://www.unrealchina.org/forum.php?mod=viewthread&tid=672&extra=page%3D1
foreach [Used to traverse the game data, using the method as follows]
local staticmeshactor myactor; foreach Allactors (class staticmeshactor ,myactor) { if (Myactor.tag = = " box " ) {myactorsize.x = 1 ; Myactorsize.y = Myactor.drawscale3d.y; Myactorsize.z = myactor.drawscale3d.z; Myactor.setdrawscale3d (myactorsize); }}
So that foreach can get all the static model in the scene and assign it to myactor, we manipulate the myactor is the static model in the operation scene, such as control his position, control his size, his rotation and so on.
In which the if is judged this gets to the Myactor tag tag is not box, if it is to change his size, simply say this is a targeted change, and will not put all the static model changed.
Spawn, instantiate a class, using the method: Spawn (class ' myweapon ',,, location,rotation,,true), instantiate a class of my weapons in the position of the protagonist, the direction of rotation of the protagonist, Simply put the non-existent object in the scene.
Spawnemitter, instantiate a particle, using the method:
var Particlesystem Damageparticle;worldinfo. Myemitterpool.spawnemitter (damageparticle,hitlocation);
Default property in Damageparticle = Particlesystem ' WP_LinkGun.Effects.P_WP_Linkgun_Beam_Impact_HIT ' [ps effect specified by itself] This means that in some cases triggering a particle effect, of course, do not expect him to have hurt, he just can see
Vsize calculates the distance function, he can subtract two vector values and calculate their distance, using the method: Vsize (mywea.location-location), for example, to determine the distance between the enemy and so on
Additional instructions: A coordinate-B coordinate, the value that comes out, is a vector from B coordinate to a coordinate. and Vsize (vector), the value obtained is not necessarily a positive number, if only for the sake of distance, or ABS (vsize (coordinate a-coordinate B)). This way the absolute value is the positive distance.
The onanimend function is used to detect whether an animation is playing, and it is important to note that your animation is not set to loop, otherwise it will not be triggered.
Event Onanimend (animnodesequence seqnode,floatfloat excesstime) { super. Onanimend (Seqnode, Playedtime, excesstime); Worldinfo. Game.broadcast (self,seqnode.animseqname);}
This will output the name of the animated animation, which is very useful.
UtpawnClass common functions:
setlocation (set coordinates)
Setrotation (Set orientation)
Setphysics (set physical type, e.g. phys_walking: Walk phys_flying: Flight phys_falling: Drop)
Postinitanimtree (Initialize the event of the animation tree, you can add what you need in it)
Felloutofworld (events that fall out of the world, usually die directly, or you can reload yourself)
PostBeginPlay (role initialization complete, enter game event)
Landed (character landing event)
Takedamage (Damage event)
Takefallingdamage (Landing injury)
Weaponchanged (the weapon has switched events)
Setcharacterclassfrominfo (functions that use resources in Familyinfo to set roles)
Setmeshvisibility (whether the switch role is displayed)
Utpawn's Mesh componentsCommon functions:
Getsocketworldlocationandrotation (get slot world coordinates and orientation)
Getsocketbyname (get slots by slot name)
Iscomponentattached (returns whether the component in the parameter is already attached)
Attachcomponenttosocket (add-ons to slots)
Attachcomponent (add-ons to (0,0,0) relative coordinates)
Detachcomponent (Cancellation of component additions)
Setscale (set model equal to scale)
Setscale3d (set model unequal ratio scaling)
SetMaterial (set model material)
Playanim (animation of the corresponding name in the animation package, not through the animation tree)
Stopanim (stop playing the animation)
The following are commonly used, otherwise easy to play crashes
Setskeletalmesh (set up a bone model, such as a substitution function)
Setphysicsasset (set physical Resource)
Setanimtreetemplate (set animation tree)
The animsets variable array of mesh holds the animation package resources that the model needs to use
utpawn Common Variables:
Health (Life value)
Healthmax (Max Life)
Velocity (Velocity)
Acceleration (acceleration)
Jumpz (jumping height)
Groundspeed (Ground movement speed)
Airspeed (flight speed)
Waterspeed (swimming speed)
Dodgespeed (double-click the jump avoidance speed of the arrow keys)
Dodgespeedz (avoidance height)
Viewpitchmin (the lowest angle of the bow, negative.)
Viewpitchmax (the maximum angle of the head, these 2 angle values are 65535=360 degrees, but generally look up to the sky is 90 degrees, so the maximum is set 65536 (16 10000)/4-1=16383, the same angle of the bow. If you want to make a plane, Because the plane can fly backwards, you can widen the limit. or modify the Limitviewrotation function in Playercontroller.)
Bblockactors (whether to block other actors, if you do not want to 2 actors can block each other, set false can cross each other, to 2 sides are set to line)
infrequently used variables:
Breplicatehealthtoall (whether to sync the health value to all players)
Bcandoublejump (can 2 even jump)
Maxstepheight (can be crossed the maximum height, set large can directly from downstairs to the roof _, set small will be the roadside small stone block)
Bcanjump (whether to jump or not). Literally and practically, that's true. But this variable also has a hidden function: When set to False, you will not be able to go down from the platform (down)
Bcancrouch (can squat, hide function: Set to False, Ai's pathfinding function will be greatly affected, can go past the place also cannot go past)
Crouchheight and Crouchradius (the size of the collision box after squat, but also related to the AI pathfinding, the setting is small, the AI will be more flexible pathfinding, but if it is smaller than the AI itself collision box, it is possible to get stuck in things)
Bprojtarget (whether it will be a bullet hit, in fact, I did not use it)
Summary of common functions of UDK