rotating and moving script_mover


(Zer0Cool) #1

Hi,

I want to make a script_mover rotating the whole time with the same speed and in the same direction. The script_mover should also move along waypoints.
My script doesn’t work and looks like this:

kugel_start
{

trigger start
{
trigger kugel start
}

}

kugel
{

spawn
{
wait 500
setrotation 90 45 0
}

    trigger start
    {
  
      gotomarker ziel1 100 

      setrotation 90 45 0

      gotomarker ziel2 100

      setrotation 90 45 0

       wait 1000


 }

}

I know that there is the command “faceangles” but I am not sure if I could use it when it should rotate all the time with same direction and speed.


(Flippy) #2

I’m not sure about this actually…

I am pretty sure that you should use ‘setrotation’ indeed, since faceangles can only make it turn in a given angle. Once it reached that angle it stops. (In theory you could make it turn an angle like 10000000000 degrees which would essentially be the same as turning forever, but i doubt that would be good… Entities tend to behave weirdly at their limits lol.)

What exactly isn’t working? The rotation part or the moving part?
It could be that the setrotation doesn’t kick in until the moving has stopped. It might be that it simply can’t cope with these two commands at the same time.

An alternative would be to make it into a func_rotating, and attach that to a tag of a moving (blank, empty, invisible) model. (Look for ‘attachtotag’).

Other than that I don’t know…


(Zer0Cool) #3

it starts rotating and when I touch the trigger it goes to point1, there it still rotates, but didnt moves to point2.

how can i attach a func_rotating to an invisible script_mover?

zer0


(murka) #4

this could only be a typo problem, as it is rotating and moving.


(Zer0Cool) #5

i added a “wait” after “gotomarker ziel1/2 100” and now it also moves to the second point and rotates all the time. BUT after it arrives “ziel1” it starts to rotate new and it doesnt fit to the rotating from before.
Anyone an idea?

And it would be nice when sbdy could explain me how I can attach a func_rotating with a script_mover


(Flippy) #6

Well then it seems to work perfectly ok.

It starts rotating again from the start because you told it to do so. You have another ‘setrotation’ command right after the ‘gotomarker ziel2’ command, which makes it restart the rotation.


(Zer0Cool) #7

can you tell me how I can do it not starting rotating new? What i want is that it moves along the points and rotates the whole time same without interruptings or new starting


(Flippy) #8

I guess all you have to do is don’t repeat the ‘setrotation’ command? If that stops the rotation alltogether then I don’t know…


(Zer0Cool) #9

yes, it stops the rotation when dont repeat the setrotation. :confused:

can sbdy explain me how I can attach a func_rotating with a script_mover?


(Loffy) #10

attach a func_rotating with a script_mover?

Hi
I am not sure you can do that. But I might be wrong.


(Zer0Cool) #11

A further question:

Do I need for every script_mover a own trigger_objective_info? Or can i use one trigger_objective_info for more script_movers?


(Flippy) #12

Why do you need a trigger_objective_info (TOI) at all for a script mover?

A TOI is used for objectives like ‘destroy the …’ or put around a tank. It’s the entity that shows the “You are near the…” message.

You will only need it for objective based movers, like a tank or truck. For movers like a gate or maybe some special effects like a moving plane in the sky or whatever, you don’t need a TOI.

And no, if you do have to use a TOI, you can only use it for one objective.

I suggest you do some research about the entities you’re asking about since this would have been clear if you did.


(Zer0Cool) #13

lol, sorry i meant target_script_trigger, not trigger_objective_info!
Oo english is not my language, i confused that … sry


(Flippy) #14

Same answer applies lol… Only a target_script_trigger is used to trigger the game to run a piece of script.


(Zer0Cool) #15

ok. and how many of them can I use? is there a maximum?


(S14Y3R) #16

Hi Zero('n peeps), I wrote a tutorial a while back on how to use a tag_model.md3 with a script_mover for mounting an mg. The same principals apply for using other entities as well. Including func_anythings.

In the example_map, I just tested a func_rotating attached to one of the tags in the model and it does work fine. Read through the tutorial, and instead of setting up for an mg, just set a tag at the model origin and attach your func_rotating to it, then move your script_mover to wherever you need and the func_rotating will follow accordingly, always rotating at its own discretion(it won’t restart rotating when a path_corner is reached, like with setrotation), it’ll work fine even if you want to use info_train_spline_main & controls for more realistic movements.

here’s the link to the tutorial:

Mount an mg to anything using a tag_model.md3

gl, and happy mapping.

[sidenote]
lol, i gotta plug my work more if nobodies remembering it, heh heh.
[/sidenote]

mappers rule!


(Zer0Cool) #17

Thx for the link. I’ll try to understand the text :wink:


(Zer0Cool) #18

I tried to change it for my mover but it does not really work. the attached func_rotating does move with the script_mover but it does not rotate.

Here what I have done:

Entities:

classname: script_mover
targetname: master_mover
scriptname: master_mover
model2: models/kugel.md3
tagent: kugel
spawnflags: 2 (solid)
target: ziel1
with an origin-brush in the centre

classname: path_corner
targetname: ziel1

classname: target_script_trigger
scriptname: kugel_start
targetname: kugel_start
target: start

classname: trigger_multiple
target: kugel_start

classname: func_rotating
targetname: spot
scriptname: spot
spawnflags: 1 (start_on)

md3_tag_the_dummy:

Modelinformation:
Filename: kugel

Origin:
Tagname: Origin x=0 y=0 z=0

Tags
Tagname: tag_spot x=0 y=0 z=0

-> both files into /etmain/models/

Script:

game_manager
{
spawn
{
wm_axis_respawntime 1
wm_allied_respawntime 1
wm_set_round_timelimit 10
}

}

spot
{
spawn
{
wait 100
attachtotag master_mover tag_spot //line up origin of model with tag_spot
}
}

kugel_start
{

trigger start
{
trigger master_mover start
}

}

master_mover //this script_mover has spot attached to it.
{
spawn
{
wait 100
}

trigger start
{
	gotomarker ziel1 100 gototime
	wait 1000
}

}

Please tell my waht I have done wrong :slight_smile:


(S14Y3R) #19

k, oops, i thought the func_rotating was working on its own. but it isn’t. :oops: It’ll still work though, you just need to add a setrotation under your attachtotag line, and it will rotate constantly while attached to the script_mover.



spot
{
spawn
{
wait 100
attachtotag master_mover tag_spot //line up origin of model with tag_spot
setrotation x x x // <---
}
}

…since the dang func_rotating wont work properly :/, and manual rotation is needed anyway, you may as well turn “spot” into a script_mover instead of a func_rot.

Besides the lack of rotation, its all working though, eh?

gl.


(Zer0Cool) #20

I added the setrotation and it works fine.
Thanks for the help!

zer0