need some help with my truck


(dwe_flame) #1

i used that prefab script generator,

but the truck still wont totally work

i already tryed running trough the map and script, but cant fin the error.
axis should be able to escort the truck, while the allied must stop it with the barriers.

could somone maybe take a look at it ?

** i also want to make it pick up 2 objectives (this part was not added althou i click it at the generator?) and if posseble i want it to be around spline 50 (the middle one beween barrier 2 and 3)

hope someone could help me out here a sec

here is the file. zip contains the .map and the .script


(C) #2

Hi there,…

I see it isn’t working :S
There is indeed something missing in the script:

A quick fix is adding 1 lline to it…
but then the truck will “jump” once at the start…
I’ll fix it asap…

truck
{
	spawn
	{
		wait 50
		accum 1 set 1 //<-------------------------- add this
		constructible_chargebarreq 1.0
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10

(dwe_flame) #3

thank you a hell of a lot :smiley:

you can also contact me at xfire if you find the problem what is bugging it all

xfire is: dante591986

cheers :smiley:


(C) #4

I changed the webpage…
The problem should be fixed now…(without a jumpstarting vehicle)

C…


(dwe_flame) #5

so i will need to remake the prefab from the website ?

i clicked i wanted 2 objectives, this didnt seem to work also.

how can i add those manual at a point along the path ?


(C) #6

The objectives is only needed when selecting a truck,
There is 1truck that cannot carry objectives, because it has no tags for it.

But the generated script is not (yet) setup to handle objectives.

That is because in fact it has not so much to do with a vehicle… only the “loading an objective and attach it to the truck” is…

I just made the prefab generator for things that are always almost the same to create…
a complete mission is often different…


You can attach models at any time to a truck (that has tags to attach something to)…
The 2 tags for attaching objectives are called: tag_obj1 & tag_obj2
If You want to attach some model, with a scriptname of goldbar1, to one of the tags, just do this in mapscript:

goldbar1
{
   trigger loadgoldontruck
  {
      attachtotag truck tag_obj1
  }
}

// then call the trigger to actually load it:
trigger goldbar1 loadgoldontruck


(dwe_flame) #7

ok, got the truck all working now.
stealing the gold also looks to work now

but i only want the truck to stop at about spline 50 (the one that is not in line) and let it wait there till both gold crates are loaded on truck.

cant get this to work :\

maybe someone can have a look at it and help me out ?

zip contains the .script and .map

1000x in advance!


(S14Y3R) #8

Ey, I tried to add an extra stopcheck to your script and it still won’t stop. Someone will figure it out, eventually/hopefully. You might need to reduce you’re barrier’s to 3, as it seems C’man uses all of accum 3’s bits for stopchecking, he might know how to add your feature, or not, or he might feature gold stops in future prefabs. I’ve been out of it too long to know of a quick fix, those are just ideas :slight_smile:


(C) #9

I think an accum has 32 bits… so plenty left to code with…

Yes i know :-)… it’s funny…

You must create some additional stuck-checks for the truck (or maybe 1 if the objectives are all loaded at the same spline)…
This stuckcheck contains the spline where the truck should stop… (just like the barricade stuck-checks)

…and You must create some trigger(s) for the truck so it knows when an objective is loaded onto the truck (and it can continue moving again)… (much like the trigger barricade1_constructed, only then an objective1_loaded trigger)

Then add some code to the trigger_flagonly_multiple’s death-event ,where the objectives are delivered, to inform the truck that an objective has been loaded.

That is all…
I could add this to the Prefab-Generator one of these days…

— edit -----------------------
To dwe_flame:
I just took a look at Your map & script, but it is not entirely complete… i do not see the entities for: gold_crate, gold_full_0, gold_full_1, gold_trans_0 & gold_trans_1…
I also notice You have 2 scriptblocks for goldbar_holder…

But anyway… add the following to Your the truck script You posted:
in trigger stuck_check add the check to see if all objectives have been loaded:

	trigger stuck_check
	{
		accum 3 bitreset 1
		trigger self stuck_check_scriptlockout
		trigger self stuck_check_finished
		trigger self stuck_check_barrier1_built
		trigger self stuck_check_barrier2_built
		trigger self stuck_check_barrier3_built
		trigger self stuck_check_barrier4_built
		trigger self stuck_check_objectives_loaded
	}

Also add the trigger stuck_check_objectives_loaded:

	trigger stuck_check_objectives_loaded
	{
		accum 1 abort_if_not_equal 50
		accum 5 abort_if_equal 2
		accum 3 bitset 1	// stuck
	}

(S14Y3R) #10

Yea, I did try adding a -stuckcheck routine, with setting accum 5 set 2 and also globalaccum 0 set 0 then 2 after, (after global 0 inc’s didn’t work), etc…Tried a bunch of other options too, but I’m missing something i could’ve caught a year ago. C’mon guys check this out so C’man can get this fixed for all of us, and of less but equal importance to DWE and people, for testing it.

C Still rules because it works before altering, its just the bits used in the stopcheck I think are messing up any alterations.

Once you get used to what he© uses for accums in the generator, it gets easier to figure out, I’m just too stoned atm. logging on to some WF for a while…they don’t mind stoned too much, heh heh.


(C) #11

I got the accum 5 from his script… He uses it to count the number of objectives that have been delivered… maybe You were overwriting that value.

I did not test the script, but i think it should work…

btw: i am glad that dwe_flame reported the not-completely-functional script, because the webpage has already been accessed hundreds of times in just a few days…


(S14Y3R) #12

The whole thing works great overall, its just what he has tried to add, is either in the wrong place, or something else is altogether wrong… have a look at his script, he’s tried a stop in run_continue with a globalaccum(i changed that out too), plus I tried putting an extra stopcheck under accum 5 in the truck adding to its stuckcheck routine:

trigger stuck_check_waitforgold
{
accum 1 abort_if_not_equal 50

    accum 5 abort_if_not_equal 2 
    
    accum 3 bitset 1
}

You should see something in there that we can’t. You da’ man!


(dwe_flame) #13

this is what i have now:


	trigger move_to_50
	{
		trigger self wheels_forward
		setstate goldbar_holder default
		accum 5 abort_if_not_equal 2
		accum 3 bitset 3
		followspline 0 path_49 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}
	

now it will stop at spline 49 (not at 50 ? )
and wait for the gold to be loaded on to it
(accum 5 i used for gold counter)

but there is still 1 error now left.
the wheels keep spinning while the truck is waiting haha


(dwe_flame) #14

ok now it is fixed and fully working :smiley:


	trigger move_to_50
	{
		setstate goldbar_holder default
		trigger self wheels_stop
		accum 5 abort_if_not_equal 2
		
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_49 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

it accualy stops at the point of where spline 49 is, but this aint a problem :slight_smile:

thanx thanx!


(C) #15

I guess You did not see what i had posted before…
No problem, now You tried it Yourself… that’s good… /better
Allthough Your current code has a somewhat higher spaghetti-ratio, it will work nevertheless… :wink:

You have put the check in the move-code for spline 49…
trigger move_to_50, …move-TO… the truck is at 49 when it should move to 50

i named the move triggers like that, because it makes more sense with splines…
The followspline-command takes a spline as a parameter, it is the begin-spline of the move it will make… from the given spline to the next…

Followpath-commands don’t do that… That command’s spline (or path_corner) is the spline that a script_mover will move to… from where is now is to the given spline.