Script move (in a straight line...DOOOH!!!)


(surrenderdorothy) #1

Well chaps heres the deal, I want to script move a crate so that it moves across your field of vision from left to right, goes in a hole and comes back out again traveling back along the same path.
Now I went over to Nibs site to try with his script mover tut(very nice indeed)but sadly it wasnt succesful(maybe cause its for MP? I am working on SP at the moment, or maybe the values in his script needed to be changed and I have no knowledge of how to do that…lots of stumbling around in the dark here!)so I would ask if there are any other scripting tuts out there dealing specifically with script movers could someone post a link up?
Cheers in advance!!!

<font size=-1>[ This Message was edited by: surrenderdorothy on 2002-12-06 15:44 ]</font>


(kat) #2
  • make your crate and turn it into a script_mover with a origan brush connected to it somewhere (it doesn’t necessarily need to be in the center of the script_mover)
  • give it a scriptname/name key/value pair (ie: key=scriptname value=crate1
  • place a couple of path_corners into the map following the direction you want the crate to move, giving them unique key/value names (ie: key=targetname value=corner_point1)
  • create a script section in your *.script file like this…

crate1
{
spawn
{
trigger crate1 go
}

trigger go
{
gotomarker corner_point1 24 wait
gotomarker corner_point2 24 wait
trigger crate1 go
}

}

[the numbers above are the speed at which the script_mover moves. ‘Wait’ tell the script_mover not to read onto the next line of the script until the current event is finished - moving to each path_corner in this case]

how the crate starts will depend on what you’re trying to do ingame, usually you just trigger the event on spawn, but if it’s a complex series of event’s you wouldn’t want to have those running until they’re needed so you’d place a trigger field in the map which is activated by the player, this inturn then starts the script.


<font size=“2”>nothing to add your honour… except… maybe quake3bits?? Is that alright?? oh and rtcw is that better??</font size=“2”>

<font size=-1>[ This Message was edited by: kat on 2002-12-06 19:46 ]</font>


(surrenderdorothy) #3

OOOOHHHHHH!!! Its happening!!! The bugger is levitating all over the place!!!
Cor blimey!!!
Cheers man, you made it real!!!


(surrenderdorothy) #4

Bloody Nora!!! I just made a moving conveyor belt as well!!!


(SCDS_reyalP) #5

Dotty scripting ? And liking it ?

Welcome to the dark side. :smile:


(surrenderdorothy) #6

:smile:


(kat) #7

On 2002-12-06 23:58, SCDS_reyalP wrote:
Dotty scripting ? And liking it ?

Welcome to the dark side. :smile:

I raise a blood filled goblet to that…!


(demoneye) #8

Scripting is great :smile: Now if only it has some better structures…

If…Then…Else

Loop…Until…Repeat

DeMoNeye


(surrenderdorothy) #9

Baptism of fire has begun :sad: me working conveyor belt was pulling me leg…its a bit buggered…here is what I did
The conveyor is horizontal on the floor, so I:

  1. Took a cylinder(BIG bugger) and flipped it and stretched it way out and using v pulled the vertices so that the part of the belt that would be seen would be level.
    2.Placed caulk under the cylinders to keep out the void.
  2. Went to the ends of the cylinder which were sticking way the fug out the sides of my hull and encased those two ends in huge slabs of caulk.
    4.Placed origin on belt, activated it and the belt and made it the mover.
  3. Following Kats’excellent little script I placed me paths along the belt and under it making in my mind a flattened circular path.
  4. Put script in map file ran it and watched it for a second and ran away gleefully hooting for joy!!
    Went back half an hour later and saw it being ripped out of my world after 15 seconds(sob!)
    There you have it!
    Now I am pretty clear on my mistake in imagining that somehow the paths would take up the different attributes of the cylinder(I thought I was clever in intersecting the paths with the cylinder mesh!)and make it move as if there were an invisible central axis holding it all in place!!!
    Ha! The nievity of the man, eh?
    I tried also using a cylinder and an origin as a func_rotate to get this movement(conveyor belt)but alas and alack without success! :sad:
    Can anybody here tell me how the hell I would go about constructing such a movement?
    Hells bells!!!

Whole lotta love in here!!!

<font size=-1>[ This Message was edited by: surrenderdorothy on 2002-12-07 01:30 ]</font>


(demoneye) #10

Do you just want the surface of the moving belt? I would use a shader to do this, and use a “tcMod scroll <sSpeed> <tSpeed>” command to move the surface.

DeMoNeye


(surrenderdorothy) #11

Demoneye, that sounds wonderful but I have no idea what you mean…can you elaborate a little …pleeeez!!! :smile: :smile: :smile:


(kat) #12

you could create the belt with a series of script_movers sections, they wouldn’t nee to be that small either. Just lay out a couple of path_corners for the top bit (the bit players see) and then another couple ‘under’ the map (the S_Ms will drop below the surface and move between points) You may need to play about with the speed and the number of sections for the belt as you’ve got to give the illusion of constant unbroken movement. It is very ‘do-able’ but you’re gonna need a lot of experimenting to get it right.

If you use the shader method as demoneye mentioned your biggest problem will be syncronising the speed the script_mover and the texture scroll (tcMod is that grovey effect you see on textures that ‘move’ around) this may prove very difficult.


(demoneye) #13

I’ll get back to you on the shader…

Syncing them will be no problem, the speed unit on gotomarker is units/second and tcmod speeds can easily be controlled.

I’ll get my act togther tomorrow and do a quick demo map…

DeMoNeye


(surrenderdorothy) #14

So my original idea may not have been so wacky and pie in the sky as I had thought?
Hhhhmmmnnnnn! Hope bloossoms in the tired old heart. :smile:


(demoneye) #15

Hi…

OK, a couple of things in here to help.

First, here’s a shot of what I’ve done…

http://www.btinternet.com/~dave_and_sarah/images/convey.jpg

And here’s the file…

http://www.btinternet.com/~dave_and_sarah/map/convey.zip

Have a look and see if it’s any use. The trouble with using a shader for the conveyor is that you don’t move if you stand on it! Let me know if you want more info.

Look at the shader (reference the shader manual to see what it’s doing) and the script to see how the crates are moving.

DeMoNeye


(kat) #16

…The trouble with using a shader for the conveyor is that you don’t move if you stand on it!..
shouldn’t be too much of a problem if the crates are moving (scripted script_movers) as they’ll push the player along giving the illusion of ‘proper’ movment. nice 1 demoneye


(surrenderdorothy) #17

Demoneye, thanks a whole lot for taking the time to put that together, I am looking at it and I need to ask myself is it the crates that are pulling the conveyor along?
I have looked at it in Radient(extensivly!)and pondered the script and that seems to be the case. How would you go about a simple conveyor from left to right non-stop with nothing on it(and it wont be standonable so theres no worries about it being seen as fake!)with it simply moving constantly?
Again,demoneye thanks for the trouble you took on doing that and that zip is useful to me to look at!
But… I really have no clue about script moving…I have read the tuts and the principles are clear but how to do it I cannot fathom!!! this conveyor problem…to loop a surface so that it moves constantly? what holds the axis???
Man!!! I am lost here!!! :sad: :sad:


(demoneye) #18

Well, the conveyor is not actually moving at all, it’s a solid standard brush. Take a look in the convey.shader file in the scripts directory of the PK3.

Note, the line “tcmod scroll 0 1”. This scrolls the shader (not the brush it is on) once a second. The shader image, conveysurface.tga, is 96x96 units, so the conveyor is effectivly moving at 96 units/second. I’ve set the speed of the gotomarker commands in the script to 96, which again is 96 units/second! So the boxes appear to move on the elevator!

Finally, the rollers, have a shader applied to them with a “tcmod rotate 873” - which rotates them around their centres - 873 degrees per second. Little bit of math, diameter of 16, circumfrance of 2pir, so 39.57. Therefore (96/39.57)*360 = 873 approx!

Also note, that script movers can’t be lit by the environment they move through, and as they all start out under the conveyor, I’ve added some lighted textures down there to apply light to them!

Phew…

Contact me on ICQ 146666266 or MSN david.m.nicholls@talk21.com and I’ll explain more if you want.

DeMoNeye


(kat) #19

…to loop a surface so that it moves constantly? what holds the axis???
Man!!! I am lost here!!! :sad: :sad: …

Dotty you’re not actually trying to create a ‘circular object’ that has an actual center of rotation (point) but creating the illusion of that by placing path_corners in such a way as to give the impression that’s what’s happening… the script_movers just move from point to point, which is what you’ve instructed the objects to do in the script - move from point ‘A’ to point ‘B’, to point ‘C’.

Demon also highlighted a problem that wasn’t mention before and that was the lighting on the script_movers… you have to ‘over compensate’ and do what he did by adding lighting in the hidden areas of the map…


(surrenderdorothy) #20

Kat, I do and I did understand that I am in the illusion business here(all mappers are, no?)and to use paths to move an object in the world is clear and straightforward to grasp, the problem I have here is that this object needs to move yet at the same time stay in a fixed location(illusion again!)so if I direct my convevor materiel to move from path a to b then c maybe its the case that the entire brush has moved to the c location and anyone standing looking at the conveyor belt would see it dissapear out the wall as it rushes to meet its destiny with path c!
Demoneye’s kind offer on further help with this is sincerly appreciated yet I hesitate to go off on a tangent with shaders and shader properties…I wanna try and solve some things at this point with script movers, bloody hard as that may be!!!