Home   Help Search Login Register  

Author Topic: Building a Camp?  (Read 2466 times)

0 Members and 1 Guest are viewing this topic.

Offline Nexolate

  • Members
  • *
  • The lurking S.T.A.L.K.E.R.
Building a Camp?
« on: 25 Mar 2008, 20:05:40 »
Sorry if this has been discussed already or there's some script that I've missed, or even if it's that blatantly obvious.

Could someone explain to me how the whole "building the camp" thing works in the Side-Mission "The Camp". It's the one where you have to protect a group of Engineers as they do just that, I think it's a side-mission for Gryphons.

I get that they're sunk into the ground using the setposition code on initialization, however I don't see how they gradually rise back up. Nor how the engineers trigger this. I've had a look at the mission myself in the editor and can't make sense of it.

Thanks again.
You'll only notice me when it's too late.

Offline Loyalguard

  • Former Staff
  • ****
Re: Building a Camp?
« Reply #1 on: 26 Mar 2008, 10:21:30 »
I am unfamilar with the mission...can you post a link to it?

Offline Barbolani

  • Members
  • *
Re: Building a Camp?
« Reply #2 on: 26 Mar 2008, 15:43:33 »
lol its from the original campaing....

The method is simple, initialize the buildings setposing them under the ground (third parameter under zero), create a waypoint to the engineers, when they reach the waypoint activate a script that:

- animates the engineers to move like they're working.

- gradually from time to time setposing the building with higher altitude until 0, when its 0 the script ends and allows the engineer to move to the next WP

- if the engineers die, the script ends

cya!

Offline Nexolate

  • Members
  • *
  • The lurking S.T.A.L.K.E.R.
Re: Building a Camp?
« Reply #3 on: 26 Mar 2008, 17:31:47 »
I thought it was something along those lines, I just couldn't make heads or tails of all the different names they'd assigned things.
Cheers for that Barb, I'll look into it at a later period.

EDIT: Just checked, I tried it with a fence and a Trigger Area. I had to keep going in and out of the Area to get it to work.
I then tried it with a Waypoint, but even though the Waypoint was synchronised with a Trigger which wouldn't complete until the fence was done, it still completed instantly.
I then tried it with an AI, and the same thing happened.

http://img232.imageshack.us/img232/1499/79170844iy8.jpg

The waypoint says:
Code: [Select]
Condition: True
On Act.: buildwf=1; wftimer=0

The second waypoint just acts as an end, so that when he's done building he moves on.

The trigger on the left says:
Code: [Select]
Condition: (getpos wf select 2 > -0.20);
On Act.: buildwf=2

With wf being shorthand for Wire Frence.

The trigger in the middle says:
Code: [Select]
Condition: (buildwf==1 && wftimer==0) && (getpos wf select 2 < 0)
On Act.: wf setpos [(getpos wf select 0), (getpos wf select 1), (getpos wf select 2)+b]; wftimer=1;

With b being an integer (in this case 1).

The trigger on the right is basically just setting b=1.

The fence itself says:
Code: [Select]
wf setpos [getpos wf select 0, getpos wf select 1, -4]; buildwf=0
Can anyone explain why it still jumps to the next waypoint, regardless of that first trigger?
« Last Edit: 26 Mar 2008, 21:08:03 by Nexolate »
You'll only notice me when it's too late.

Offline Barbolani

  • Members
  • *
Re: Building a Camp?
« Reply #4 on: 26 Mar 2008, 21:36:51 »
nonono man, this is impossible without scripting

Use waypoints just to move the engineers from one place to another, when they reach the waypoint a script should be called for each item

Are you familiar with scripting?

Offline Nexolate

  • Members
  • *
  • The lurking S.T.A.L.K.E.R.
Re: Building a Camp?
« Reply #5 on: 26 Mar 2008, 21:46:58 »
Relatively, I was using the original mission as reference and that's how they were doing it.
How would you reccomend doing it, in a basic form. The scripting I've been doing so far doesn't involve a variable such as a Unit dying.

EDIT: Also thanks for bearing with me.
« Last Edit: 26 Mar 2008, 22:01:58 by Nexolate »
You'll only notice me when it's too late.

Offline Barbolani

  • Members
  • *
Re: Building a Camp?
« Reply #6 on: 27 Mar 2008, 16:37:19 »
Ok, ill try at home. In fact I was interested on building a script of those..

The problem is that wont be as clean and performantic as a script guru could do


Offline Nexolate

  • Members
  • *
  • The lurking S.T.A.L.K.E.R.
Re: Building a Camp?
« Reply #7 on: 27 Mar 2008, 21:33:22 »
Lol, I only asked for a general concept, but thanks all the same.
You'll only notice me when it's too late.

Offline Barbolani

  • Members
  • *
Re: Building a Camp?
« Reply #8 on: 30 Mar 2008, 16:32:03 »
GOT IT

In the editor:

Place an engineer, lets name him "engineer1"

Place a building, whatever you want, name it "building1"

On the initialization of the building lets bury it. Place something like this setpos [getPos this select 0, getPos this select 1, -x] where x is a number enough to bury it avove ground (-6 with tents is ok)

Place a move waypoint for the engineer, destination the building, on activation [engineer1, building1] exec "construct.sqs"

And here is "construct.sqs"

Quote
_eng = _this select 0
_build = _this select 1

_att = getPos _build select 2

~3

#Update0

_att = _att + 0.5
? _att > 0 : goto "Update1"

~2
_build setpos [(getPos _eng select 0) +3, getPos _eng select 1, _att]
; player sidechat format ["edificio enterrado a %1",_att]

goto "Update0"

#Update1

exit

Needs polishing but it will make the building until its altitude is equal to 0. Plz note that yo can change the velocity (the pause) and the range of meters the building rises each time

Needs also adding some playmoves for the engineer, but i havent time to find the correct one

Cya!

Offline Nexolate

  • Members
  • *
  • The lurking S.T.A.L.K.E.R.
Re: Building a Camp?
« Reply #9 on: 30 Mar 2008, 17:59:31 »
Excellent, I was beginning to wonder what happened to you.
Cheers for that, really appreciative. I might go try it out now.

Also, if you find a suitable animation, could you post back here? Thanks.

EDIT: What's the commented line for? Some kind of confirmation message?
« Last Edit: 30 Mar 2008, 18:01:36 by Nexolate »
You'll only notice me when it's too late.

Offline Barbolani

  • Members
  • *
Re: Building a Camp?
« Reply #10 on: 31 Mar 2008, 11:46:19 »
yup, checks if the tent is raising

the animation... theres an ofpec resoruce with ALL the anims, but there areTONS... I donno the corect one... maybe somebody here can tell... I think the Healing anim would work...

Offline Nexolate

  • Members
  • *
  • The lurking S.T.A.L.K.E.R.
Re: Building a Camp?
« Reply #11 on: 31 Mar 2008, 17:38:38 »
2 secs, I found that a couple days ago when I was choosing an anim for some Mechanics...

"AinvPknlMstpSlayWrflDnon_medic"

If you put a delay of 6 seconds in he should restart the animation just as he bends down to pick his gun up, making it look like he's just reaching down for another piece.
You'll only notice me when it's too late.

Offline Cheetah

  • Former Staff
  • ****
Re: Building a Camp?
« Reply #12 on: 01 Apr 2008, 17:25:41 »
Just came across a thread called Building Script. It's a good read with two examples of build scripts. However, these are focussed at building a sandbag wall, it should be easy to replace this with building a tent or whatever you want to build.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline Nexolate

  • Members
  • *
  • The lurking S.T.A.L.K.E.R.
Re: Building a Camp?
« Reply #13 on: 02 Apr 2008, 15:34:02 »
Don't those raise the structure instantaneously though, rather than gradually like in the original campaign mission?

Also, would it be possible to trigger this script with Human Players?
Like adding an Action to "Build Structure" when you're near it, and as long as you stay near it it'll continue to build.
That or you could force them to stay there with an animation like the medic one, with a "Cancel/Pause" Action for that?

Lol. I really need to learn advanced scripting. ;P
You'll only notice me when it's too late.