Moving a target_effect


(Chruker) #1

Is there anyway to move a target_effect entity around?


(chavo_one) #2

The only way to move a target_effect (or most any entity for that matter), is to attach it to a model tag. If the model is part of a script_mover and you attach the target_effect to one of the model’s tags, then you can move the target_effect by moving the script_mover.

Someone around here has created a model that only consists of tags, so this might help you if you don’t want anything visibly attached to the target_effect.


(Erik-Ftn) #3

hmm, u could also try the setposition command, I’ve found it working in some circumstances. Put eg path_corners where u want it to go, set targetnames and then script.


(Chruker) #4

I’ve got it working. I ended up creating a md3 model which just contains tags at the distances I want.

Actually first I started writing a utility in c++ for it, but as I’m still learning that language, I keept banging my head against various problems.

Then I throught I could just write a script i php. But I found it wasn’t that easy to write binary correct data. Finally I did found the correct commands (thank you, pack() and unpack()). So now I have a script that generates a .md3 and a .tag file.

I’ll polish the code, add some forms to it, and make it available on a website, so others can use it to generate their own dummy models.

The reason why I needed to move the target_effect, was that I have created a tank, which is surround by triggers. When a player moves into one of the triggers the tanks turret aims at him and fires a grenade at him. I needed the target_effect to follow the distance triggers so I could have an explosion near the player.

Currently the tank will target and kill any player inside a 2048 unit radius. In fact its pretty hard to get away from it without being killed.

Tomorrow I’ll try to make a truck that’ll hunt you and try to run you over :wink:


(Erik-Ftn) #5

hmm ,I was thinking bout a similar thing once, the fact that setposition works both for target_effect and path_corner can be used for this.

eg, make triggers on a field, when a player, switches a button, light the triggers, for the first four triggered triggers, “setposition” a path_corner to the targetname of the trigger and then “gotomarker” a missile or something there.

I also though about making a battledroid :slight_smile:

a player selects a fire-direction from inside the droid w eg a button or two, then script a script mover: “setpostion” (position of droid), “setspeed” (the direction wanted) then place say 10 target_effects along the movement with “setposition” and “wait” and finally set them all off. w “alertentity”. booooooooooooom :slight_smile:

You could also move the droid freely btw a number of path_corners with gotomarker and stop.

I’m not going to, so if you want, pls take my idea :-).