Scripts / whats did I do wrong here

Author
Message
DennisW
16
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 1st Mar 2015 00:13
What I am trying to do is put a entity next to the player. Not sure if I am going about it the right way.

Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester
GoDevils
10
Years of Service
User Offline
Joined: 24th Sep 2014
Location: Arizona USA
Posted: 1st Mar 2015 02:55
Try using SetPostion(e,x,y,z), instead of ResetPosition

"There is no spoon"
DennisW
16
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 1st Mar 2015 03:13
I tried that and the entity appears where as before it did not appear,but it dose not go to the position of the player. Do I have to UnlockPosition of the entity? I saw that some where.
Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Mar 2015 12:29
you need to turn collision off before you can move stuff
so
CollisionOff(e)
SetPosition(e,g_PlayerPosX,g_PlayerPosY,g_PlayerPosZ)
CollisionOn(e)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
DennisW
16
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 1st Mar 2015 12:34
OK thanks I will give it a try.
Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester
tomjscott
User Banned
Posted: 1st Mar 2015 15:44 Edited at: 1st Mar 2015 15:46
Also, make sure the entity you are attaching a script to is set to dynamic. They are static by default.

And, by your script you are going to be setting the entity position to the player's position at the time the script is initialized, which happens only once per entity. So, this script will continuously set the entity to the player position that was detected when this entity initialized. If the player moves then this entity will still move to the original player's position. If you want the entity to continuously move to the player's "current" position then you need to get the player's current values in main, not in init.
System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
DennisW
16
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 1st Mar 2015 15:47
Thanks smallg that worked out .
Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester
DennisW
16
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 2nd Mar 2015 16:09
@tomjscott

You are correct on that I did add +125 on each X,Y,Z position. Things are working out good Thanks.
Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester

Login to post a reply

Server time is: 2024-12-21 14:48:26
Your offset time is: 2024-12-21 14:48:26