I have an area of my map where poisonous gasses fill the room and kill you if you mess up the puzzle and become trapped. The problem is that the Slime Damage does not seem to be able to kill the player. It just keeps creating more and more damage as time progresses. Is there a script to cause the Slime Damage area type to kill the player?
An alternative method for using the Slime Area I think may work is using a Script Area and coding it so that when the player enters, they take damage. I have a very basic knowledge of scripting though, so I am at a loss and my script does not work (posting the .hps below).
I also tried copying the Slime Damage script directly from the game.cfg file, but that didn't work so I gave up there. If there is some sort of damage or kill area script out there I don't know about, please let me know as well!
Ah! Just remembered that The Cistern Entrance level does have a poisonous gas area with the following script. Going to try and implement it into my map using the same techniques and maybe this can turn into a tutorial :p
So simply copypasta didn't work with that script. Viewed the Cistern map and copied the PoisonStart area and Stop area and plopped them in the spot on my map and they did not work with the script. The map loads, but when the player enters the areas, nothing happens.
(This post was last modified: 08-15-2014, 08:03 AM by DaPurpleHippo.)
afAmount - amount of damage done to health
asType - plays a certain effect on the screen when the damage is dealt (BloodSplat, Claws or Slash)
abSpinHead - changes the camera view when damage is dealt
abLethal - set to true if player can die from given damage
Edit: I see you have used it, but used it incorrectly.
A float is a decimal number between 0 and 100.
A string is a line of text which is enclosed in quotation marks ( "" )
A bool is a boolean, which means true or false.
If you want it in the correct format, right at the bottom of the code I did in this spoiler, you should find one which works!
Edit 2:
I may have misinterpreted - My one (should) work if the door should NOT open, which would fail the puzzle. If it is incorrect, use First Captain's solution below me
Spoiler below!
Your code is also a bit messy - it almost seems that it would crash when you run it :o
void Happening(string &in asName, int alCount) { //When you respawn, if anything is supposed to happen, put it here. }
void move_top_down(string &in asEntity, int alState) { if(alState == 1) { SetMoveObjectState("top_door", 1.0f); } else { GivePlayerDamage(100.0f, "blood", false, true); //Will instantly kill the player if they do the wrong thing. }
Discord: Romulator#0001
(This post was last modified: 08-15-2014, 08:40 AM by Romulator.)
RE: Making it so Slime Damage can Kill, need help!
Thanks for explaining the script Rom. And Captain is right, I want it so that when the player is in the area, they take damage. Think of it as a simple Slime Area, but it can actually kill. I did some experimentation and came up with this code that does not crash the map:
void Happening(string &in asName, int alCount)
{
//
}
void move_top_down(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("top_door", 1.0f);
for (int x; x == 4; x++)
{
GivePlayerDamage(25.0f, "blood", false, true);
}
}
}
but it also does not work :/ if you enter the area where you should be taking damage, nothing happens at all. The issue may be related to the map editor as well, but I'm not sure :/
EDIT: I'm adding a screenshot of the room in the editor mode so the situation is clearer.
Spoiler below!
In the upper right corner is the section where the poison is supposed to be. The player pulls the right lever on the left side and the door will open for a short time. If the rest of the puzzle is not completed by the time the door closes, the player is trapped. That is where the poison comes in and will kill the player. The respawn point is at the entrance to the room.
(This post was last modified: 08-15-2014, 09:11 AM by DaPurpleHippo.)
RE: Making it so Slime Damage can Kill, need help!
I just realized this. In GivePlayerDamage, the second argument is string &in asType. "blood" IS NOT one of them. The Types are: BloodSplat, Claws and Slash.
You need to experiment between the three. Replace the GivePlayerDamage function with one of these. If you don't like it then change into the other two.
RE: Making it so Slime Damage can Kill, need help!
Still just nothing. Names matchup, changed the Type, script runs fine as there are no crashes and the door is working fine. Even tried messing with true/false values and 1,0,-1 values in different ways to see if there was some magic combo or something. I'm gonna pick this up in the morning but any more suggestions are greatly welcome. I feel like if there was a way to get the script from the Cistern Entrance map working in this scenario, that would work out the best but for now, any way to kill the player in the corner room over time works.
I was thinking of editing the water monster in the model editor so its silent/invisible, but I don't know if it works on land and wouldn't want it to escape the room. I'll sleep on it, and get back to this later. Thanks for the help so far!
RE: Making it so Slime Damage can Kill, need help!
(08-15-2014, 08:34 AM)Romulat✪r (✿◠‿◠) Wrote: A float is a decimal number between 0 and 100.
That's not quite true, Rom. 0-100 wouldn't be much use.
A float has the range +/- 3.402823466e+38, or in other words between -340,282,346,600,000,000,000,000,000,000,000,000,000 and 340,282,346,600,000,000,000,000,000,000,000,000,000.
The bigger the number is (in either positive or negative direction) the less precise it becomes.
Also, DaPurpleHippo, try this:
RE: Making it so Slime Damage can Kill, need help!
(08-15-2014, 08:46 PM)MrBehemoth Wrote:
(08-15-2014, 08:34 AM)Romulat✪r (✿◠‿◠) Wrote: A float is a decimal number between 0 and 100.
That's not quite true, Rom. 0-100 wouldn't be much use.
A float has the range +/- 3.402823466e+38, or in other words between -340,282,346,600,000,000,000,000,000,000,000,000,000 and 340,282,346,600,000,000,000,000,000,000,000,000,000.
The bigger the number is (in either positive or negative direction) the less precise it becomes.
Also, DaPurpleHippo, try this:
For the sake of the code in this case, I probably should have mentioned that the float should be between 0 and 100 because the health range is 0 <= x <= 100.
Regardless, I stand corrected
RE: Making it so Slime Damage can Kill, need help!
(08-15-2014, 11:25 PM)Romulat✪r (✿◠‿◠) Wrote: For the sake of the code in this case, I probably should have mentioned that the float should be between 0 and 100 because the health range is 0 <= x <= 100.
Regardless, I stand corrected
Ahhh, I see your point. Well then, we're both right. Huzzah!