What I'm trying to do is is a moveto on an entity, which I can do easily, but the problem I'm having is figuring out how to keep the entity in front of the player at all times. For example:
This is not my exact code but a mockup of what I'm trying to do. I noticed the geteye() function in the ugx script references, but to my understanding that gets the angles of the player's facing direction. This is where my problem is, I can't figure out how to adjust the moveto coordinates relative to the player's facing angle. For example, if north is +x, and south is -x, and so on for y and z, how can I convert the facing direction to a relative offset of the player. If anyone could give me some suggestions I would greatly appreciate it, as well as give you credit in a mutual project I'm working on. Hopefully I explained my intentions clearly, if not let me know and I'll elaborate.
If you want scripts / features made for you, then contact me by PM or email / skype etc it will cost you tho so if you have no intention of reciprocating don't even waste my time
I was getting an unknown function with that, so I searched some of vanilla scripts and found anglesToForward() which I'm assuming is what you meant. However, I don't understand the syntax as shown in the ugx scripting reference:
It seems redundant to me looking at it. Why is a variable being defined and then sent in the same line? I tried anyways with every permutation of the syntax I could think of, but trial and error yielded no results This is the last code I tried, which compiles fine but nothing is printing: Any further help is greatly appreciated. In the meantime I'll keep trying, and I'll update if I have any luck. Double Post Merge: August 13, 2016, 04:45:43 amThe code I posted, I drafted just for an example to be short, and forgot to define "players". So to make it easier I'll loan you the full code I'm working on that I'm using it in:
This is a trap I made, named Entity 115. It has a master singularity that floats above a totem, and then it shoots energy wave projectiles (looks like ball lightning with glowing plasma) at enemies for 1 minute. Once you upgrade it, the singularity is supposed to follow the player above their shoulder within sight of the first person view. This is the only thing I can't get to work, I included all the code that I wrote for this section if it helps. Double Post Merge: August 13, 2016, 05:01:44 amSorry I keep forgetting things, on the line where it says
zombies setGoalPos(orb.origin);
Disregard//comment that out if you test it, it was just something I was fooling around with last night trying to get the zombies to path towards the singularity, which I don't think I want to use anyways. But for some reason that line (I think) was spawning a second master orb above the script model that the "original" master orb spawns at, weird... but unrelated. Double Post Merge: August 13, 2016, 05:43:31 amGrrr
I just realized how retarded my last edit was. I posted that script and forgot that I removed the getangles part of it so I could isolate it until I got the iprints working. So in that code, when the minions are spawned, they spawn on the master orb and path to the zombies. When the master brain part threads the zombies as self into the minion spawning logic, the minions are spawned at the master orb origin, so naturally if the orb is floating right wing to the player then the minions will follow suit, which is the intention. This is where I need to get the players angles so I can toss them into the while loop so that before the minion spawns each cycle, the master orb will get moved to the little devil spot so the minions get dispatched above the player. Double Post Merge: August 13, 2016, 06:03:49 amI noticed a few more errors
Here is the current working version of the script: The test_angles_and_print() function at the end I can't get working. I don't know if it's the syntax, I can't tell which part is failing, I'm getting no errors Double Post Merge: August 13, 2016, 06:15:54 am+5 more idiot points for me. *Fixed and removed undefined variable "orb_radius" on line 46
Last Edit: August 13, 2016, 06:15:54 am by Archaicvirus
Thanks man. I'm almost done making a variation of it where it doesn't shoot projectiles, but acts as an energy barrier circling the player. To be honest, it's going to be one of four easter egg style wonder weapons, like with the bows or staffs. Each one is going to have an elemental effect, like the singularity one, a wind style one that will have a small radial effect similar to the thunder gun, one will be fire tornado's circling the player and sending out smaller tornado drones, and the last one is going to be similar to the gersch device. It's a big undertaking but pretty persistent. I'm sure I'll be bugging more on the forums for help along the way haha.