Last active: Never
Not logged in [Login - Register]
Portal Portal   Search the forums Search   Frequently Asked Questions FAQ   View member list Member List   Staff Staff List   View Topic Activity Topic Activity   Forum Stats Stats   Board Rules Board Rules   Downloads Downloads
Go To Bottom

Printable Version | Subscribe | Add to Favorites  
Author: Subject: Slow death of a player question
tony991
Corporal


Avatar

Avatar


Posts: 121
Registered: 6-1-09
Member Is Offline


[*] posted on 13-1-11 at 07:35
Slow death of a player question


How do I make it so the player dies slowly after an event has been triggered? I know about the area trigger and the health rate but I need something that doesnt harm the player in an area until a certain event is triggered. Can it be done through wac or can I teleport area triggers?



View user's profile View All Posts By User U2U Member
ShadowZ
Administrator
********

Avatar

Avatar


Posts: 486
Registered: 20-2-09
Location: Texas, U.S.A.
Member Is Offline

Mood: Not enough hours in a day

[*] posted on 13-1-11 at 09:43


You might be able to put in a .WAC.

Give ya a hint, use "If never AND event" and experiment with loops.




Time is not my enemy, although we do have many disagreements...


http://www.dfreload.com/shadowz/SGMod/SGSig.jpg http://www.dfreload.com/shadowz/MarkSigR.gif
View user's profile View All Posts By User U2U Member
Baldo_the_Don
Administrator
********

Avatar



Posts: 915
Registered: 12-5-08
Member Is Offline

Mood: New Computer!

[*] posted on 14-1-11 at 01:05


The player's trapped in a room with a destroyable door (the strong one from the russian embassy basement mission) and no explosives but hand grenades. The room is supposed to be filled with gas, or maybe fire or something.

3D area X is the whole room, the door is SSN Y:



if area3d X and ssnalive Y then sub health 1 endif



With full health and depending on which difficulty level the player is using, that line of .wac gives the player 50, 100 or 200 seconds to get out of that room. Maybe make the door indestructible 'til the player shoots it, or trigger the destructibility when the player has n health left. Or 'sub health 2' to double the dying rate. Slowing the death rate is tricky but:



if area3d X then inc vR endif
if gt vR Z then set vR 0 endif
if eq vR 0 then sub health 1 endif



Let's say Z=4. The player would lose 1 health every 5 seconds. Z=2: 1 health every 3 seconds.



At least I think this'll work, I'd have to test it.




View user's profile Visit user's homepage View All Posts By User U2U Member
tony991
Corporal


Avatar

Avatar


Posts: 121
Registered: 6-1-09
Member Is Offline


[*] posted on 14-1-11 at 07:12


Quote:
Originally posted by Baldo_the_Don
The player's trapped in a room with a destroyable door (the strong one from the russian embassy basement mission) and no explosives but hand grenades. The room is supposed to be filled with gas, or maybe fire or something.

3D area X is the whole room, the door is SSN Y:



if area3d X and ssnalive Y then sub health 1 endif



With full health and depending on which difficulty level the player is using, that line of .wac gives the player 50, 100 or 200 seconds to get out of that room. Maybe make the door indestructible 'til the player shoots it, or trigger the destructibility when the player has n health left. Or 'sub health 2' to double the dying rate. Slowing the death rate is tricky but:



if area3d X then inc vR endif
if gt vR Z then set vR 0 endif
if eq vR 0 then sub health 1 endif



Let's say Z=4. The player would lose 1 health every 5 seconds. Z=2: 1 health every 3 seconds.



At least I think this'll work, I'd have to test it.


Ya, I'm playing with fire. I never knew that there was a sub health in BHD. It wasn't on the wac list.
I've been messing around with it and I can't get it to work. I've even tried putting a negitive(-) number thinking it might be the same as the area trigger health rate but nothing.

Maybe you'll know what I'm doing wrong.
Here's the wac...

If ssnarea3D(10000,93) and event(10) then
sub health(3)
endif

I want the player to loose health fairly quick.




View user's profile View All Posts By User U2U Member
Baldo_the_Don
Administrator
********

Avatar



Posts: 915
Registered: 12-5-08
Member Is Offline

Mood: New Computer!

[*] posted on 14-1-11 at 19:46


Quote:
Originally posted by tony991
Quote:
Originally posted by Baldo_the_Don
The player's trapped in a room with a destroyable door (the strong one from the russian embassy basement mission) and no explosives but hand grenades. The room is supposed to be filled with gas, or maybe fire or something.

3D area X is the whole room, the door is SSN Y:



if area3d X and ssnalive Y then sub health 1 endif



With full health and depending on which difficulty level the player is using, that line of .wac gives the player 50, 100 or 200 seconds to get out of that room. Maybe make the door indestructible 'til the player shoots it, or trigger the destructibility when the player has n health left. Or 'sub health 2' to double the dying rate. Slowing the death rate is tricky but:



if area3d X then inc vR endif
if gt vR Z then set vR 0 endif
if eq vR 0 then sub health 1 endif



Let's say Z=4. The player would lose 1 health every 5 seconds. Z=2: 1 health every 3 seconds.



At least I think this'll work, I'd have to test it.


Ya, I'm playing with fire. I never knew that there was a sub health in BHD. It wasn't on the wac list.
I've been messing around with it and I can't get it to work. I've even tried putting a negitive(-) number thinking it might be the same as the area trigger health rate but nothing.

Maybe you'll know what I'm doing wrong.
Here's the wac...

If ssnarea3D(10000,93) and event(10) then
sub health(3)
endif

I want the player to loose health fairly quick.


Yeah, I figured it out. The sub health doesn't work. This does:

Code:


So all this basically gives the player 10 seconds in the death zone, no matter the difficulty level. Adjust v3 as you see fit.

I'm also sure I forgot to account for the player taking damage outside of area 3 and how that changes v2, but it's lunchtime now, I'll check it out later.

Sammiches.




View user's profile Visit user's homepage View All Posts By User U2U Member
tony991
Corporal


Avatar

Avatar


Posts: 121
Registered: 6-1-09
Member Is Offline


[*] posted on 15-1-11 at 22:51


Quote:
Yeah, I figured it out. The sub health doesn't work. This does:

Code:


So all this basically gives the player 10 seconds in the death zone, no matter the difficulty level. Adjust v3 as you see fit.

I'm also sure I forgot to account for the player taking damage outside of area 3 and how that changes v2, but it's lunchtime now, I'll check it out later.

Sammiches.


Ok, I'll have to mess around with it later today. I'm not that familiar with variables but i'll give it a try.




View user's profile View All Posts By User U2U Member
Baldo_the_Don
Administrator
********

Avatar



Posts: 915
Registered: 12-5-08
Member Is Offline

Mood: New Computer!

[*] posted on 16-1-11 at 01:01


It took me quite a while to figure out how to use variables, too. The best way I can think to describe variables is that they are counters. They count stuff. What they count depends on how you trigger their changes.

They can be confusing, but I find them useful enough to work with whenever I can.




View user's profile Visit user's homepage View All Posts By User U2U Member
tony991
Corporal


Avatar

Avatar


Posts: 121
Registered: 6-1-09
Member Is Offline


[*] posted on 16-1-11 at 06:00


It works great! I just added an, if event(x) is triggered to make is so the player starts loosing health after the fire starts. Great work Baldo! I owe you one.

Hey, what other wac triggers/events do you know of that aren't mentioned in the forums?




View user's profile View All Posts By User U2U Member
Baldo_the_Don
Administrator
********

Avatar



Posts: 915
Registered: 12-5-08
Member Is Offline

Mood: New Computer!

[*] posted on 16-1-11 at 07:04


Well, there's...

set seatbelt 1

...which prevents the player from detaching from emplaced weapons and...

set seatbelt 0

...which lets him go again. You have to be careful with it though. Like in the mission "Besieged," if you're unlucky, you can get stuck on a .50 cal. and can't complete the mission.

Then there's...

sunfade 100 300

...In maps with a day1 to day6 .env file, if you look up in the sky, you'll see the sun shining into your eyes, blinding you. If you trigger a sunfade 100 300, that visible sun will disappear in 5 minutes (300 seconds). (Note: making it go from day to night is a bit more complicated than just making the sun fade!)





I'm sure these are mentioned in the forums somewhere, but you won't find them in the KYLE.WAC, which of course is the .wac writer's go-to source of reference.




View user's profile Visit user's homepage View All Posts By User U2U Member
tony991
Corporal


Avatar

Avatar


Posts: 121
Registered: 6-1-09
Member Is Offline


[*] posted on 16-1-11 at 08:15






View user's profile View All Posts By User U2U Member

  Go To Top





Powered by XMB
Developed By The XMB Group © 2001-2008