PDA

View Full Version : Script move (in a straight line...DOOOH!!!)


surrenderdorothy
6th December 2002, 15:43
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
6th December 2002, 19:44
- 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 (http://www.quake3bits.co.uk)?? Is that alright?? oh and rtcw (http://www.cpdt.com/rtcw) is that better??</font size="2">

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

surrenderdorothy
6th December 2002, 21:55
OOOOHHHHHH!!!!! Its happening!!! The bugger is levitating all over the place!!!!!
Cor blimey!!!!
Cheers man, you made it real!!!

surrenderdorothy
6th December 2002, 23:27
Bloody Nora!!! I just made a moving conveyor belt as well!!!!!

SCDS_reyalP
6th December 2002, 23:58
Dotty scripting ? And liking it ?

Welcome to the dark side. :smile:

surrenderdorothy
7th December 2002, 00:25
:smile:

kat
7th December 2002, 00:45
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
7th December 2002, 00:52
Scripting is great :smile: Now if only it has some better structures...

If...Then...Else

Loop...Until...Repeat

DeMoNeye

surrenderdorothy
7th December 2002, 01:28
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.
3. 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.
5. Following Kats'excellent little script I placed me paths along the belt and under it making in my mind a flattened circular path.
6. 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
7th December 2002, 02:01
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
7th December 2002, 02:04
Demoneye, that sounds wonderful but I have no idea what you mean....can you elaborate a little .....pleeeez!!!! :smile: :smile: :smile:

kat
7th December 2002, 03:07
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
7th December 2002, 03:26
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
7th December 2002, 07:55
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
7th December 2002, 15:46
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
7th December 2002, 17:04
.....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
7th December 2002, 18:56
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
7th December 2002, 19:10
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
7th December 2002, 19:51
...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
7th December 2002, 22:31
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!!!!

demoneye
7th December 2002, 23:20
Dot - If you want to know anything about sctipt movers, I'm willing to help on that. If you can describe exactly what you're after, or maybe send me a map with details I'll give you a step by step guide.

DeMoNeye

Ghast
8th December 2002, 18:46
Woo Hoo, this thread has been such a benefit to my own little project! Keep asking those questions Dotty! And big THANK YOUs to Demoneye and Kat for everything so far, keep it coming!!! *G*

surrenderdorothy
8th December 2002, 20:38
Ah demoneye you wee wonder that you are..your guidance got me on track with that and it wasnt as complicated as I had feared.....but....(and believe me, I only call for help when I have worked and worked and worked on it meself to no avail!!!) as you know I have two conveyor belts on each side of the room, they both move in the same direction and I would like if one goes in the other direction(one is left to right, I would like the other right to left)for variety. So my weak brain commanded me to copy my texture and rename it, put it back in the texture folder, go to the shader file and copy/paste the (existant)working conveyor belt block into the shader and rename that to my new secondary conveyor texture(known as badboyconvey)and then fug around with the values........fair nuff, no?
So I have been here all afternoon trying a trillion combos of decimal points and numbers with no success in getting badboy to reverse himself(aptly named wee shite!)
here is the shader so far:

textures/bootcamp/conveysurface
{
surfaceparm metalsteps
qer_editorimage textures/bootcamp/conveysurface.tga
{
map $lightmap
rgbGen identity
}
{
map textures/bootcamp/conveysurface.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
tcmod scroll 1 0 -0.01
}
}

textures/bootcamp/badboyconvey
{
surfaceparm metalsteps
qer_editorimage textures/bootcamp/badboyconvey.tga
{
map $lightmap
rgbGen identity
}
{
map textures/bootcamp/badboyconvey.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
tcmod scroll (WTF GOES HERE????) -0.01
}
}

So if anyone can tell me that missing value please please let me know(please refrain from guesswork but if thats all you have I will gladly take it :smile: ) so I can move on with my life!
If anybody tells you that old shite about a load of monkeys, typwriters and works of shakespeare...just give em a shader with missing values and tell thenm what effect you would like to see!!!! Ha! Bollocks to monkeys!!!!!!

_________________
Whole lotta love in here!!!

<font size=-1>[ This Message was edited by: surrenderdorothy on 2002-12-08 20:40 ]</font>

<font size=-1>[ This Message was edited by: surrenderdorothy on 2002-12-08 20:41 ]</font>

<font size=-1>[ This Message was edited by: surrenderdorothy on 2002-12-08 20:42 ]</font>

surrenderdorothy
8th December 2002, 20:43
Me heids in a vice!
(I do come from Glasgow!)

<font size=-1>[ This Message was edited by: surrenderdorothy on 2002-12-08 22:23 ]</font>

demoneye
8th December 2002, 23:01
Ummm... What can I say, you do like to make things complicated :smile:

Pick the orginal conveyer and copy it. OK, you've got two conveyers now going in the same direction. Go to the second one, select the face with the conveyor texture on, hit "S" for shader amendment ("shift+S" if on a patch) and rotate the texture by 180 degrees. Now the texture will scroll in the oposite direction!

DeMoNeye

surrenderdorothy
8th December 2002, 23:46
Hells bells!!! That was a piece of cake...see! I never would have come up with that!!! I would have kept battering away at the shader script thinkng that there would be the answer and not in actually rotating anything in Radiant. My logic teling me that it would make no difference to rotate it as the direction is being called by the shader script!!!!
Bloody Hell!!!!
Again, cheers man!
Sorted!

Whole lotta love in here!!! :smile:

kat
9th December 2002, 01:00
On 2002-12-08 23:46, surrenderdorothy wrote:
Hells bells!!! That was a piece of cake...see! I never would have come up with that!!! I would have kept battering away at the shader script thinkng that there would be the answer and not in actually rotating anything in Radiant. My logic teling me that it would make no difference to rotate it as the direction is being called by the shader script!!!!
Bloody Hell!!!!
Again, cheers man!
Sorted!

Whole lotta love in here!!! :smile:

sometimes it helps to go do another section of the map, you brain will gestate the info whilst you're doing that then it'll 'pop n click' and suddenly it'll make sense..! :smile:

Ghast
9th December 2002, 19:21
well evidently Dotty got Demoneye .map to compile?

For some incountable reason I get a "can't find q3map error" ???

Recomplied KoS' recent para.map (took forever) without a hitch, so it shouldn't be the scriptmovers, and no, I am not using 1.2.11, but a clean version of 1.2.9 still.

not a priority, just curious *G*

surrenderdorothy
9th December 2002, 19:54
Yeah man, that map compiled no problem, is there a reason why you are on version 9 and not 10? I also use a custom ydnar Q3map (v 2.3.0-a1 which my Project leader has specified as its right for us)but I dont imagine that demoneyes map can be at fault here. Man, check yer paths!

demoneye
9th December 2002, 22:01
Map compiles fine on 1.2.11 of GtkRadiant. Must be the version of q3map you're using - I'm currently using 2.3.33, and was using 2.3.32 when that map was compiled.

DeMoNeye

kat
9th December 2002, 22:03
On 2002-12-09 19:21, Ghast wrote:
well evidently Dotty got Demoneye .map to compile?

For some incountable reason I get a "can't find q3map error" ???

Recomplied KoS' recent para.map (took forever) without a hitch, so it shouldn't be the scriptmovers, and no, I am not using 1.2.11, but a clean version of 1.2.9 still.

not a priority, just curious *G*
Sounds like a shader problem?? Might be due to some new implimentation in the latest ydnar that's not compatable with older versions of GTK and q3map...!?

I'm using 1.2.9 +2.10 update and won't upgrade (to a full clean install) until my current projects is done..

Ghast
10th December 2002, 08:50
that's the answer then, hadn't run into it before is all *G* To answer Dotty's question, I see a whole lot of questions/problems posted, but the scariest is stuff that doesn't appear UNTIL a map is reaching near completion!

Good enough for example maps is not good enough for SPing, and since I am not using any terrain features anyhoo, messing with the newer Q3maps is a distraction *LOL*

Why build with caulk hull if you're not going to have any fps issues anyhoo?

LtColSteiner
21st December 2002, 22:56
I'm having an annoying error with my script_mover. I know that I have the script and everything correct because I did get things to move at one point. But now, I get this error when I try to play my map: "GScripting: cannot find entity with "targetname" = "bcsouth"", even though I do have a path_corner with that exact targetname. I found out that if I go back, delete these path_corners and make a new one, the problem is "solved".
Any clues as to why this is happening? I have many script movers, and it is real annoying to have to go back, delete, then create the same path_corner all the time.

demoneye
21st December 2002, 23:22
This sort of problem, is normally down to the path corner not actually spawning before it's referenced. In the spawn section of the script mover put a "wait 5" command.

This will wait 0.005 seconds before referencing the path corner, and should allow time for it to spawn.

Let me know if that helps.

DeMoNeye

LtColSteiner
22nd December 2002, 03:15
ah ha! that seems to have fixed it. i thought it was a whole bunch of unrelated problems.
thanks for your help.
there hasn't been a better forum where I can get help with wolf mapping than here

digibob
27th December 2002, 12:52
This sort of problem, is normally down to the path corner not actually spawning before it's referenced. In the spawn section of the script mover put a "wait 5" command.

This will wait 0.005 seconds before referencing the path corner, and should allow time for it to spawn.

Let me know if that helps.

DeMoNeye

Just a little note on this: 50ms is actually the shortest length of time you can tell anything to wait, and only 50ms increments after this will work, any other values will be rounded up/down (most likely always up).

BrushBaron
7th January 2003, 04:12
Scripting is great :smile: Now if only it has some better structures...

If...Then...Else

Loop...Until...Repeat

DeMoNeye

try Heavy Metal: FAKK2, Alice, or MOH. You can do anything pretty much.

chavo_one
7th January 2003, 16:38
This is actually a question, but I know that in scripting your player config files, the wait command is the number of frames to wait. Is that true for script movers as well? If so that would mean the time a "wait 5" takes would be totally dependent on the fps.

digibob
7th January 2003, 16:43
Nope, it's milliseconds.