followspline


(isbowhten) #1

i want to make a truck but you could say those guys which know how to do it tell you to copy just their script because it works. !!
they have their 700 lines script which i don’t understand.
i want to do it on my own, so i started to try a simple brush to move from beginning of the map to the other corner… i used the info_spline_control , the spline_main AND both together… couldnt figure it out… the error is:
after devmapping it.

G_Scripting: can’t find spline with “targetname” = “point1”

can anyone just say me what to do that a simple brush turned into script_mover moves without conditions just in the other corner of the testmap?


(th0rn3) #2

Well its hard to explain go to 2bit, theres a tutorial of a simple scrip_mover. When you learned that go and see a sample in the goldrush, check the map, then a script


(isbowhten) #3

well, here is only a tank. i just want to use followspline, but it doesnt find its target.
only one simnple direction from corner to corner… there are too many things i dont know in the tank-tutorial


(Wezelkrozum) #4

you must target an info_spline_main to an other info_spline_main
The first info_spline main do you give the targetname point1
And the other do you give the targetname point2
Use this command in your script: followspline point1
And the script_mover will move from point 1 to point 2.


(isbowhten) #5

okay
:slight_smile: thanks


(isbowhten) #6

ôk i tried it… but the same error occurres… why?
info_spline_main
target: point 2
targetname: point 1
ifo_spline_main
targetname: point 2

scriptcommand:
followspline 1 point1 100


(murka) #7

maybe you are running that too soon as entities need to get spawned, so add a wait 100 and see if it fixes.


(isbowhten) #8

this semms to be correct… the problem is … the map loaded… i forgot to generate a tracemap … so the game didtnt go on… i had a wrong key in the worldspawn … i corrected it… now map isnt laoding…
“awaiting gamestate”… is all i can see


(isbowhten) #9

i have to close ET with CTRL + ALT + ENTF


(-SSF-Sage) #10

Firstable you can’t have spaces on the target/targetnames afaik, you just might made a typo here on the forums I think.

Secondable, try to remove your script file and load the map. If it loads, read your script for typos.

If it does not load, but you get in after fixing something and it doesn’t work, make sure the followspline command is loaded.

If it’s the map file where the error comes from, you can always check the file in wordpad etc. to see if everything is ok.

Also remember to have the script_multiplayer in your map, this doesn’t crash it, but it doesn’t load your scripts if you don’t have 1, only 1.

Also if you plan to make an escortable truck from the scratch, good luck. There are prefabs too.


(isbowhten) #11

i dont understand those prefabs… but i want to understand it… so i am going to make my own one ^^
well … the map loads now but the script_mover doesnt move… it just disappears!
??? i tested it with a speed of 100000 and 1 … so i did no mistake with the speed… => it must just disappear.


(murka) #12

when the mover moves to the end of the spline it will disappear(or did it go to the map origin?), just add an extra splinepoint on which it doesn’t move.


(-SSF-Sage) #13

Do you have spaces on your targets and targetnames? Make sure they are connected and the targetname (point1) matches with the targetname in your followspline command. Your error sounds like it goes into the center of the map, or was it origin. Which happens when you don’t have them matching, in other words, it doesn’t find a spline to follow.

Again it is going to be easier and faster to start just reading the script from the prefabs. It doesn’t contain many places to change afterall. You can read it from goldrush. Tank tutorial in 2bit’s site will helps.

You can start out with checking out these triggers from the truck script; dispatch and run_number.

I can give you a little brief on how it works. Note I spend some mins for this so I might have made a little mistake somewhere.

I won’t include repairing, and destroying stuff. Only when it does move. Ofc it has a lot more stuff, but this is gonna get you started.



In the map:

"truck_trigger" *trigger, multiple -> some 1 activates* -> alerts "truck_enabler"-> goes to the script ***means that player is standing on the trigger

from the script:

"truck_enabler" triggers "truck_enable" from the truck scriptblock. ***Here it checks if the truck is dead, makes wheels turn etc. Most important: triggers a trigger called "move".

In "move" it triggers move_check and starts looping"move" for some reason. ***sidenote: but it will check if the player is standing in the trigger etc.

In move_check it triggers stuck_check where it looks if we can move. And triggers "dispatch". 

In dispatch you can see a long row of "accum 3 trigger_if_equal *number*" commands. This will basicly check what value the accum 3 has and executes to the right "run_*number*" trigger.  ***basicly checks where we are at the splines.

Now depending on the value of the accum 3 it triggers one of the "runs". 

In the "run_x" it moves the truck and sets the next value for the accum 3. It also triggers "run_continue" in the last line, which will trigger a couple checks and then trigger "move" again.

But again I don’t want to discourage you, but it is going to be a heck of a work, to start it from the scratch. Go for it if you feel you wanted to!

Edit:

ps. Was it you murka that ripped and made into prefab the truck stuff from the grush? I remember it included some kind of editing tutorial too.


(murka) #14

yup, ill try to find that grush truck prefab, i even fixed the bug of the engine_sound not getting attachtotagged(which happened if you just copied to your map).
if i do find it ill refine it a little, as i remember it didn’t have all the qualities like 2bits tank tut.


(isbowhten) #15

all names match… the mover just disapperas… the origin is within my map. the mover isnt seeable.


(murka) #16

its two possibilities that make the truck disappear(by going to the origin of the map).
it either can’t find the next splinepoint or the splinepoint that you have “followspline”-d can’t be found.
wait some minutes, ill make my truck prefab complete, ill make it playable and text messages in-game for better understanding.


(-SSF-Sage) #17

If you still gonna want to make the truck from the scratch, good luck and live long, not to discourage you ofc. Read my last post it has the basic idea about how the truck script works in goldrush to get you started.

I’d still again suggest you to use a prefab and modify it if you need to. You can just keep on reading the script file and you should get some idea in couple days.

If you are just trying to get a simple script_mover to move, download an example prefab which comes with some tutorial, and see what it includes and what is different to you.


(murka) #18

I strongly suggest using 2bits tank tutorial, i read it through and tried making my own, and it took me only an hour or two to understand how the system works.
I think ill be able to upload my prefab with in-game instructions and stuff in about 30min.


(isbowhten) #19

well… without a barrier if it doesnt matter… ´the barriers i would have to script on my self… it isn’t only one barrier… if barrier 1 then stop. if barrier 2 change route.
on the other route: if barrier 3 then stop
if barrier 3 but not barrier 2 then just pass the barrier2, then no barriers occurres anymore


(murka) #20

take a look at uje_… dunno what the end was, but it had two possible routes for the tank to move.
im doing some finishing touches for my prefab, upload in 5min.
edit:grab it here
report any problems you might find.