Spawning item....

  • 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.

Darion

New Member
Sep 17, 2000
25
0
0
www.angelfire.com
Yes. I have looked at this and this looks a LOT more helpful than the PUF.... excellent work in creating something like this. And yes, I do have a question. I was wondering how would you code something like this:
You fire a weapon and it spawns an item at your exact location (ex. item would be Damage Amplifier)

I know how to spawn items and stuff.... but how would I get it to spawn exactly at the location of yourself? Or another person for that matter.
 

2COOL4-U

New Member
Mar 17, 2001
505
0
0
37
dot NL
2cool.free.fr
Ok if you want to spawn a Damage ampilier from a weapon you use this code
Spawn(class'UDamage',,,Pawn(Owner).Location);
It should spawn the weapon on the location of the player
 

Euphoric Beaver

impeccably groomed
Apr 19, 2001
3,158
0
0
Great Britain
www.euphoric-beaver.me.uk
Originally posted by 2COOL4-U
Ok if you want to spawn a Damage ampilier from a weapon you use this code
Spawn(class'UDamage',,,Pawn(Owner).Location);
It should spawn the weapon on the location of the player

Sorry but two questions. :D

1) Where does it create it? eg. It's feet or stomach ect.

2) What is the ,,, before Pawn mean.
 

2COOL4-U

New Member
Mar 17, 2001
505
0
0
37
dot NL
2cool.free.fr
Originally posted by Ciced


Sorry but two questions. :D

1) Where does it create it? eg. It's feet or stomach ect.

2) What is the ,,, before Pawn mean.

1) It spawns it in the middle of the player, if you want to make it fall to the ground declare a local or a normal variable UDamage UDam
and do UDam = Spawn(class'UDamage',,,Pawn(Owner).Location);
and then UDam.SetPhysics(PHYS_Falling);

2) the ,,,'s are for optional variables we don't want to use
Code:
[b]the spawn function goes like this:[/b]
native(278) final function actor Spawn
(
	class<actor>      SpawnClass,
	optional actor	  SpawnOwner,
	optional name     SpawnTag,
	optional vector   SpawnLocation,
	optional rotator  SpawnRotation
);
see all the optional variables, you don't need to specify these, so I use ,,,'s :) Hope you understand it