I'm making something Indiana Jones inspired, and of course there's gonna be a huge stone rolling after you!
A more exact desctiption: You get thrown into a room, you look behind you, see the stone rolling towards you. You run down a long hallway, and the stone is following you.
But I don't exactly know how to do this.
:confused:
In other words, I could have use for something between func_train and func_rotate.
I noticed that the asteriods on the new asteriods map fly around, rotate and break at the same time! :eek:
How did they do this?
NOTE: At the moment, a round func_train with only one color follows you (use your imagination, and it looks like the stone is rolling!). Not very cool, but it still works pretty ok.
Icarus, you can move entities and rotate them all at once.
affect("thingy",INSERT)
{
move(<0 0 0>,<100 0 0>,3000);
rotate(<360 0 0>,3000);
}
Will rotate something 360 degrees while moving it 100 units over a period of 3 seconds, although you should use ref_tags for exact locations.
I didn't quite understand all of that...
Originally posted by WadeV1589
affect("thingy",INSERT)
{
move(<0 0 0>,<100 0 0>,3000);
rotate(<360 0 0>,3000);
}
Where to put the icarus-file?
And how do I "name" stone? (Shall i use targetname?)
Originally posted by WadeV1589
Will rotate something 360 degrees while moving it 100 units over a period of 3 seconds, although you should use ref_tags for exact locations.
How to use ref_tags?
I suggest you go and find a tutorial explaining how to make scripted elevators. There's also some old threads about that right here at LucasForums (for JO but works as well in JA). Those will explain you how to move objects with scripting, using ref_taqs.
Ok, thanks.
EDIT: I can't find anything, does anyone happen to have a link?
I found a tutorial, downlaoded behavEd, created some ref_tags and wrote a script.
But now I'm stuck.
Look here:
//Generated by BehavEd
rem ( "the rolling stone!" );
affect ( "stone", INSERT )
{
rotate ( < 360.000 0.000 0.000 >, 3000 );
move ( $tag( "stone2spot1", ORIGIN)$, < 0.000 0.000 0.000 >, 1000.000 );
move ( $tag( "stone2spot2", ORIGIN)$, < 0.000 0.000 0.000 >, 1000.000 );
move ( $tag( "stone2spot3", ORIGIN)$, < 0.000 0.000 0.000 >, 1000.000 );
move ( $tag( "stone2spot4", ORIGIN)$, < 0.000 0.000 0.000 >, 1000.000 );
move ( $tag( "stone2spot5", ORIGIN)$, < 0.000 0.000 0.000 >, 1000.000 );
move ( $tag( "stone2spot6", ORIGIN)$, < 0.000 0.000 0.000 >, 1000.000 );
move ( $tag( "stone2spot7", ORIGIN)$, < 0.000 0.000 0.000 >, 1000.000 );
move ( $tag( "stone2spot8", ORIGIN)$, < 0.000 0.000 0.000 >, 1000.000 );
move ( $tag( "stone2spot9", ORIGIN)$, < 0.000 0.000 0.000 >, 1000.000 );
}
The whole thing seems so stupid to me!
Did I really have to make 9 "move thingys"?
And how to make the script get started by a trigger?
How do I make the script loop itself?
How do I apply the code to the map?
How do I give the stone a targetname, when it's just a normal brush? (convert it to what?)
Will this work at all?
Guess what? It didn't work!
Any ideas?
Go check this thread for a better scripted elevator tutorial. You script above is missing some vital points (meaning you haven't yet grasped the whole meaning of the commands you are using).
http://www.lucasforums.com/showthread.php?s=&threadid=110416)
After reading that, you should be able to answer some of your own questions.
This is what the script looks like right now:
//Generated by BehavEd
rem ( "the rolling stone!" );
affect ( "stone2", /*@AFFECT_TYPE*/ FLUSH )
{
wait ( 0.001 );
move ( $tag( "stone2spot2", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 0.001 );
move ( $tag( "stone2spot3", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 0.001 );
move ( $tag( "stone2spot4", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 0.001 );
move ( $tag( "stone2spot5", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 0.001 );
move ( $tag( "stone2spot6", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 0.001 );
move ( $tag( "stone2spot7", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 0.001 );
move ( $tag( "stone2spot8", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 0.001 );
move ( $tag( "stone2spot9", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 0.001 );
move ( $tag( "stone2spot1", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
}
But... It still doesn't work...
When the script gets used the stone spawns in the middle of the map, invisible (
http://www.lucasforums.com/showthread.php?s=&threadid=124890). It doesn't move or rotate or anything like that...
For a start once you issue a move command it 'gets put onto another runner' or something like that...what I mean is even though you're telling the move command to take 3 seconds, once the move command has been executed the next command will be executed immediately. So
move ( $tag( "stone2spot2", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 0.001 );
should become
move ( $tag( "stone2spot2", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 3000 );
Also you don't need all 3 values for the move command, this works:
move ( $tag( "stone2spot2", ORIGIN)$, 3000.000 );
wait ( 3000 );
and that should do what you are wanting :)
Thanks a lot man! I guess the script works now, but still the same problem as before, The stone spawns invisible in the middle of the map when I run the script...
I'll tell you exactly what I'm doing:
I have created a func_static with an orgin brush inside. I've created some ref_tags as well.
I know the target_scriptrunner works.
The func static has those values and keys:
script_targetname stone2
targetname stone2
classname func_static
spawnflags 8 (crusher)
dmg 190
The ref tags has those values and keys:
orgin 7160 384 -1232 (or whatever the orgin is)
classname ref_tag
targetname stone2spot1 (stone2spot2, stone2spot3 etc.)
The script now looks like this:
//Generated by BehavEd
rem ( "the rolling stone!" );
affect ( "stone2", /*@AFFECT_TYPE*/ FLUSH )
{
wait ( 3000.000 );
move ( $tag( "stone2spot2", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot3", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot4", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot5", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot6", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot7", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot8", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot9", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot1", ORIGIN)$, < 360.000 0.000 0.000 >, 3000.000 );
}
(the red stuff = stuff that I think might be wrong)
Try doing what I said before, move the second bit of information, you don't need all 3 values for the move command, only the first and last...but being the strange thing Icarus is, it will look like this:
move ( $tag( "stone2spot2", ORIGIN)$, 3000.000 );
But then it won't rotate, right?
Erm...the move command doesn't rotate the brush, its format is
move(from, to, time).
If you want to get it to rotate you can issue a single command at the very start (if the stone is going in a straight line).
rotate(< 1440 0 0 >, 27000)
As you can see all you have to do is set the first value to a nice high number (1440=360*4 so it'll do 4 full rotations) and the second number is the time to take in milliseconds. This will be executed and then the rest executed while this is still being performed, the result is a rolling moving object.
Finally I think I understand...
This is what it''s supposed to look like, right?
//Generated by BehavEd
rem ( "the rolling stone!" );
affect ( "stone2", /*@AFFECT_TYPE*/ FLUSH )
{
rotate ( < 1440.000 0.000 0.000 >, 27000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot2", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot3", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot4", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot5", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot6", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot7", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot8", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot9", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot1", ORIGIN)$, 3000.000 );
}
Not right. :(
The stone spawns on the last tag and stays there :mad:
btw, I did something to the 3d view so now you can only see the closest brushes, does anyone know how to make you able to see all brushes again?
Do you mean that when you launch the game, the rock is spawned where you placed it in Radiant? Or is it really where the last tag is? And the last tag is in a different place than where the stone is in Radiant? Do you have some other scripts affecting the rock?
Otherwise your script doesn't seem to have anything wrong at first glance, except the rotate command, which won't help you very much, since it only accepts and affects absolute angle values, not relative.
Since you have correctly used ordinary targetnames for the ref_tags that doesn't seem to be a problem. Be also sure the script really executes, and the rock isn't just standing where you placed it in Radiant. I don't know if it matters, but the func_static has no use for the ordinary targetname.
Erm...the move command doesn't rotate the brush, its format is
move(from, to, time).
This isn't exactly true. It seems Raven has changed the specifications from the documented ones. The first vector is target destination, and the second one is indeed rotation...
Originally posted by |GG|Carl
btw, I did something to the 3d view so now you can only see the closest brushes, does anyone know how to make you able to see all brushes again?
Turn off cubic clipping.
I'm also trying to do the same thing here. I want the rolling objects to be triggered and then roll down to a final destination. Then I want those objects to REspawn at the top again. I'll have a look at the tutorials here and give it a try...then post later when I'm really stumped.
Originally posted by lassev
Do you mean that when you launch the game, the rock is spawned where you placed it in Radiant?Or is it really where the last tag is? And the last tag is in a different place than where the stone is in Radiant? Do you have some other scripts affecting the rock?
When I launch my map the stone isn't there. When I launch the script the stone spawns at the last ref_tag, stone2spot9. The stone doesn't spawn where it's placed in radiant, since it's placed on the first tag.
I have no other scripts in the map.
I don't know if it matters, but the func_static has no use for the ordinary targetname.
:confused:
Originally posted by |GG|Carl
:confused:
What I meant is that if you target (or use) func_static with the ordinanary targetname, it will just use it's own target (or usescript most probably). So, for your purposes, I don't see why your func_static would need anything other than the script_targetname.
It's hard to say what might be wrong with this rock of yours. I'm inclined to think it's some fundamental issue I cannot see based on the information you have given here.
OK. Do you mean by spawning, that the func_static is in some temporary place, away from the playeable area, and when the script starts, it should first move the rock to the first tag, then roll it along the tags to the last one?
And also, your last tag isn't "stone2spot9" but "stone2spot1", if you have a look at the script you posted above.
You see, my idea is to place the stone on stone2spot1, and then make it move like:
stone2spot2>stone2spot3> ... >stone2spot9>stone2spot1
So it'll stop where it started, on stone2spot1.
But does where I place the stone in radiant really affect where it's placed in the game? Shouldn't I get it to spawn at stone2spot1 before I make it move?
A func_static is loaded when the level starts and placed right where you placed it in Radiant. So, it's not spawned like, say NPCs, because it has no such function. "Spawning" would require that when you "use" the targetname, it would appear out of nowhere to its location.
If your func_static is not there, when you start the level, then I have no idea at all, what is going on. The only ways you have at your disposal to make a func_static disappear, is to either use the remove command (would be like "despawn") or use the set_invisible script command, which would make it invisible, obviously.
So, if your func_static appears to the start point of the circular path (which is also the end point as you explained), but does not move anywhere, then I would say your script is not launched at all.
EDIT: Well, I can always add one thing here: If you are mapping MP, then it will reduce somewhat my credibility, since I have no experience of MP mapping...
But what about the ref_tags? Are they suppoased to have targetmanes or script_targetnames?
Ref_tags have targetnames. As a rule of thumb, use only script_targetnames (or NPC_targetnames) when you affect("script_targetname") something in a script. Otherwise, you use the ordinary targetname .
Remember that the ref_tags are not some path_corners or nav_goals or anything like that. You just use them to retrieve a vector value, that is, the XYZ coordinates of the center of the ref_tag, so the ref_tag in itself is irrelevant. You could type those coordinates just by hand in the move script command, but most of the time it's easier to visualize things if you see them graphically in Radiant. What I mean is that there's not any AI or any special function considering the ref_tags. They don't control the func_static any way, and they are not used to coordinate spawning of func_statics. They are just coordinates for a script command.
I'm pretty sure the script launches:
http://hem.passagen.se/carlydergard/shot0000.jpg)
(Sorry, didn't have time to resize it)
However, this is exactly what happens:
The stone is where it shuold be. I launch the script, and the stone pops up on the last tag.
I don't read the language, but I'm guessing that's error 404...
Javisst. Den sidan berдttar att jag mеste kontrollera min stavning... Men jag bara clickade den adressen som du gav! Vad mеste jag gцra sе att jag kan se din bild?
Sorry, passagen (swedish webhotel) really sucks.
This one should work better:
http://server6.uploadit.org/files/GGCARL-stone2.jpg)
Carl....when you get it working let me know. I'm trying to do the same kind of action in my map.
Sure dude, but then you tell me if you get it to work!
:p
This is bizarre... You have tried to get the stone to roll for more than 3 months...
:violin:
Are you really 100% sure this is what it's supposed to look like:
//Generated by BehavEd
rem ( "the rolling stone!" );
affect ( "stone2", /*@AFFECT_TYPE*/ FLUSH )
{
rotate ( < 1440.000 0.000 0.000 >, 27000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot2", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot3", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot4", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot5", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot6", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot7", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot8", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot9", ORIGIN)$, 3000.000 );
wait ( 3000.000 );
move ( $tag( "stone2spot1", ORIGIN)$, 3000.000 );
}
Yeah, why not? Although as far as I know based on my experience, your rotate command does not work. The command only uses absolute angles, not relative. The values range from -360 to 360 degrees, and, for example, -90 equals totally to 270. The rotation happens following the shortest direction to the new angle, cw or ccw. So, 1440 should do nothing because it's essentially same as 360, absolute angles.
I usually place move commands in tasks, but that has no real significance. As far as I can see, it's a fine script except for the rotation.
Did some testing today, and I found out that the stone didn't actually "pop up" at the last tag, it actually moved to it (backwards, without passing the other tags)
:eek:
I'd suggest commenting out most of your move and wait lines and first try if you can get each of them work individually or in groups of 2-3.
Also remember developer 1 in the console so you get debug information on the scripts that are running.
Originally posted by WadeV1589
Also remember developer 1 in the console so you get debug information on the scripts that are running.
Yeah, that's what I did to get this message:
http://server6.uploadit.org/files/GGCARL-stone2.jpg)
Bump this since I still have to work out the details on my scripts.
Also remember developer 1 in the console so you get debug information on the scripts that are running.
Oh really? Single Player right, I used it in MP, and it worked (didnt know it gave info for scripts!!! This is really mainly of use if it works for SP, because MP.. well.. cant run scripts too well, either they wont work, they kill FPS, or they lag... or they work just fine!)
So, did you ever get it working all the way?
3 Months?! Well... I made a map and script that works perfectly, it even kills you if it hits you. It works in both MP and SP! Im about to upload it! It has rotation...
http://home.ripway.com/2003-11/40395/rolling_rock.zip)
Ok, heres the thing, This is a 10 KB file, I have 5 MBs of bandwidth a day (with this host, its the only one I have that accepts zips) but with TMU and Redemption, they sucked up my bandwidth right away! So... if it doesnt work, try back the next (early) so you can get the file.
In your map, youll need to play around with the rotate, and DONT use 360 degrees... the misc_model_static is already at 360, how can it move to the 360 position if that where its at? I used 250, or -250 and no one will be able to tell. Play around with it a bit (in you map) to get the proper rotation/speed) You could also add EFX files and sound to make it better.
Start my BSP by typing in devmapall rock. Walk out of the 'little room' and the trigger should be hit, and the script begins. If you get in the rocks way, you get crushed, easy. Check it out, post back if you have anymore trouble.
(This zip includes, 1 BSP, 1 IBI (In the right directory) 1 MAP and 1 TXT) all in the proper directories.
(For JA M/P)
Okay Luke, I'm ready to get back to this script now. But mine is much more complex than the one you have. I'm not sure if I have to do several scripts or if I can just make one script for 6 func_statics. I have 6 logs (instead of rocks) in total. I want to roll them at the same time but have the pitch off a little for each one, while still being paralell through the entire action.
Okay what's strange here is that I have copied Lukes script exactly yet it wont work like his. The only difference between mine and his is the target names for the reference points and the name of the func_static. Other than that it's exactly the same. What I want to do is script each one like I said and have it operate over and over again. Can this even be done? I mean it rolls down the hill okay but it starts off right away before I even trigger it. Also, when I stand in front of it I don't get hurt, even with crusher and impact enabled (dmg 200).
I'm open to suggestion guys. It's the same as Lukes..but it wont work the same.
Originally posted by lassev
This is bizarre... You have tried to get the stone to roll for more than 3 months...
:violin:
Stop giving the guy a hard time...you try scripting in M/P and see what happens!
I have tried and I get it to work somewhat. I will keep trying until I either get it the way I want..or abandon the idea because M/P just wont support complex scripts.
Can you make the log textures into a shader that scrolls so it looks like it's rolling? If you can do that moving them would be pretty easy.
I could try that I guess. Like the shader used for the HAILFIRE droid. But it might not look very good. Like I said the script works a little. I'm going to try mslafs compiler and see if his custom Icarus .bats will work maybe. I mean if he can make scripts work.....why can't I?
Originally posted by lauser
I'm going to try mslafs compiler and see if his custom Icarus .bats will work maybe. I mean if he can make scripts work.....why can't I?
That sounds intriguing. Care to elaborate what's it all about?
And I wasn't trying to ridicule the guy earlier. I was just kind of baffled that the problem still remained. Like you said, I don't know much about the differences between SP and MP scripting. But you are wrong if you think I have never had incredibly hard time with SP scripting - but even my most vicious problems have never lasted for 3 months (thankfully).
LOL..sorry Lassev. I didn't mean it that way. What I mean is it's very frustrating to try and figure out ANY targeting and/or scripting for M/P. I'm having one heck of a time with this map I'm currently doing. Not just the scripting but the targeting also. The same targeting I use for one door, wont work for the same application on another door! Go figure that one out.
Example (for single door): Trigger_multiple ----> func_static/off ----> door ----> func_static/on.
Trigger_multiple: use_button>
func_static/on: start off>
Originally posted by lassev
That sounds intriguing. Care to elaborate what's it all about?
Oh yeah sorry Lassev. In his source code that he released there is some .bat files that he made to compile his scripts. I don't know how they work and I have yet to try them out. But when I try to open his scripts in BehavED it tells me they were not made by this compiler as a warning.
Ahaaaa! Want to make scripts and targeting work properly in M/P?
TARGET_RELAY :D
Oh, yes. Target_relay is a nice entity altogether. I also used it succesfully in my SP map. However, the most birazze thing I have encountered is the target_counter. It's totally baffling why you can't target it straight away to some entity, like a func_door, but you must target the counter to a trigger, and the trigger to the door... (Counter --> Trigger --> Door). That's just ludicrous...