Jump to content

PlaceAtMe


tek753

Recommended Posts

Has anyone successfully had luck with this? I'd like to spawn a new chest about 100 units in front of the player.

I don't like that placeatme just moves my player on top of the item, and setpos x or setpos y is not reliable since my character can be walking on either plane (thus it wont be directly in front)

 

I'm not having an intelligent moment tonight..but is the idea to use the getheadingangle somehow to figure out whether I want to setpos y of the chest or setpos x?

I was thinking I make a conditional and then setpos y or setpos x by 100 but what would my conditional be based off of?

 

Does anyone have a suggestion? It seems those optional parameters for placeatme will not work, and using moveto creates the same problem as above (which offset to use, x or y? neither are foolproof)

 

Thanks so much guys, if you can offer suggestions I will hopefully make a good mod to pay you back :)

 

Thanks,

Mike

Link to comment
Share on other sites

Placeatme doesn't move you on top of the item you placed, you get moved because of the item you placed. Theres also no way to placeatme with an offset. Best way is to drop a plate on the floor where you want something, then target that and use placeatme (not player.placeatme). Edited by Sunnie
Link to comment
Share on other sites

  • 2 months later...

Placeatme doesn't move you on top of the item you placed, you get moved because of the item you placed. Theres also no way to placeatme with an offset. Best way is to drop a plate on the floor where you want something, then target that and use placeatme (not player.placeatme).

 

How is this done? I get the id of the plate then what? tek_7 did you get this working? I wanted to spawn a deer but not next to me.

Link to comment
Share on other sites

  • 2 weeks later...

Is this what you mean? I used it to place a campfire in front of me.

It uses Sinus and Cosinus to calculate to position

 

WEAPON Property [b]WEAPON[/b] Auto
ObjectReference CampfireFurniture
Furniture Property ULSUCampfire Auto
float GameAngleZ
float TrigAngleZ

Event OnEquipped(Actor Player)

GameAngleZ = Game.GetPlayer().GetAngleZ()
	if ( GameAngleZ < 90 )
	  TrigAngleZ = 90 - GameAngleZ
	else
	  TrigAngleZ = 450 - GameAngleZ
	endif

If Player == Game.GetPlayer()
   Game.GetPlayer().UnequipItem([b]WEAPON[/b], true, true)
Float posX = Game.GetPlayer().GetPositionX() + 110 * Math.Cos(TrigAngleZ);
Float posY = Game.GetPlayer().GetPositionY() + 110 * Math.Sin(TrigAngleZ);
Float posZ = Game.GetPlayer().GetPositionZ() + 1;
Float angX = Game.GetPlayer().GetAngleX();
Float angY = Game.GetPlayer().GetAngleY();
Float angZ = Game.GetPlayer().GetAngleZ();
CampfireFurniture = Game.GetPlayer().PlaceAtMe(ULSUCampfire)
CampfireFurniture.SetPosition(posX, posY, posZ)
CampfireFurniture.SetAngle(0, angY, angZ)
 endIf
endEvent

Link to comment
Share on other sites

Placeatme doesn't move you on top of the item you placed, you get moved because of the item you placed. Theres also no way to placeatme with an offset. Best way is to drop a plate on the floor where you want something, then target that and use placeatme (not player.placeatme).

 

How is this done? I get the id of the plate then what? tek_7 did you get this working? I wanted to spawn a deer but not next to me.

 

Drop the plate where you want the deer to spawn. enter the console while you are looking at the plate and select it so you have its ID in the middle of the screen. Exit the console and go to where you want to be when the deer spawns, open the console and type the command without player. and yes the . is included in what not to type in the console and not the end of this now run-on sentence.

 

For a deer you can enter TAI in the console, spawn the deer and go where you want to be and enter TAI in the console again to turn AI back on. i9 assume you want to hunt it and this way works too for that.

Edited by jet4571
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...