Im really going crazy...
Moderator: Moderators
-
simsalabim
- Lance Corporal
- Posts: 17
- Joined: Wed Jan 18, 2006 6:58 pm
Im really going crazy...
i hope ill find some help here... (im a n00b btw)
Game:
MOHAA
What i want:
If a player reaches a certain height, i.e. 1st floor, his health slowely decreases until he reaches the ground again.
>> if player is above (0 0 100) -> slowely decrease health
>> if he is beneath (0 0 100) -> stop decreasing
What i tried (ideas i got from here:)
trigger - i tried the trigger first (no success at all btw), then i saw somewher on this board, that if 1 player is allrdy "triggering", it wouldnt effect on a 2nd one -> discarded
Fire - i think if i put an area this big under fire, i would get major lags - or am i wrong?
Any other solutions? Is it possible to query the height-position?
thx in advance,
simsala
Game:
MOHAA
What i want:
If a player reaches a certain height, i.e. 1st floor, his health slowely decreases until he reaches the ground again.
>> if player is above (0 0 100) -> slowely decrease health
>> if he is beneath (0 0 100) -> stop decreasing
What i tried (ideas i got from here:)
trigger - i tried the trigger first (no success at all btw), then i saw somewher on this board, that if 1 player is allrdy "triggering", it wouldnt effect on a 2nd one -> discarded
Fire - i think if i put an area this big under fire, i would get major lags - or am i wrong?
Any other solutions? Is it possible to query the height-position?
thx in advance,
simsala
-
simsalabim
- Lance Corporal
- Posts: 17
- Joined: Wed Jan 18, 2006 6:58 pm
Welcome to .Map simsalabim
... it sometimes takes a while but the good news is that hardly any problem goes unsolved here
I think the main reason why you didn't get a reply yet is because you didn't post any code you tried, but are basically asking others to make the script for you. People here often like you to try things, and then will help out when you run into problems.
Now on to the actual problem, something like this will work.
I think the main reason why you didn't get a reply yet is because you didn't post any code you tried, but are basically asking others to make the script for you. People here often like you to try things, and then will help out when you run into problems.
Now on to the actual problem, something like this will work.
Code: Select all
main:
// the usual
// launch 'painful_up_there' as a seperate process
// so it doesn't interfere with rest of script
thread painful_up_there
end // ! this 'end' is often forgotten !
painful_up_there:
// loop forever
while(1)
{
// 'browse' through all players
// and subtract health if they are too high
for(local.i = 1; local.i <= $player.size; local.i++)
{
local.p = $player[local.i]
// check if player is alive, and not spectating
// there is a slight 'hole' here, as players that have
// joined a team but not yet selected a weapon
// are technically alive and not a 'spectator'
// but have not spawned yet and are still
// spectating the map.
// this is mostly a bug / inconvenience in mohaa
// that is not impossible but hard to get around
// I'm not sure if spectating players can be hurt
// if they can, then this is a potential problem
if(isAlive local.p && local.p.dmteam != "spectator")
{
// z-coordinate check
// 100.0 would be the actual radiant z-coord
if(local.p.origin[2] >= 100.0)
{
// hurt a bit
local.p hurt 0.05 // 1 hp per secod
}
}
}
// wait 1 frame (50 msec) before going through the loop again
waitframe
}
end
-
simsalabim
- Lance Corporal
- Posts: 17
- Joined: Wed Jan 18, 2006 6:58 pm
First of all - thank you very much! I'll try this one out asap.
The reason why i didn't post any code is that none of them worked AND the code i made was absolutely useless, since a trigger can only be activated by one player at a time.
So i really didnt know where to start. But believe me - i actually spent a lot of time on that problem
I mean, you can see from the topic how desperate i really was... 
Anyhow - ill try this one out and tell you if it works.
Thx,
simsalabim
The reason why i didn't post any code is that none of them worked AND the code i made was absolutely useless, since a trigger can only be activated by one player at a time.
So i really didnt know where to start. But believe me - i actually spent a lot of time on that problem
Anyhow - ill try this one out and tell you if it works.
Thx,
simsalabim
-
simsalabim
- Lance Corporal
- Posts: 17
- Joined: Wed Jan 18, 2006 6:58 pm
IT WORX - I LUV YOU! 
What i would like to add:
1. A delay of aprox. 5 secounds before it starts to kill. (I'll try that on my own first
)
2. A warning message for the Player alone "Get to Groundzero - You have 5 secounds!" - is that possible? i mean a message that only the player will see?
T i a,
simsalabim
What i would like to add:
1. A delay of aprox. 5 secounds before it starts to kill. (I'll try that on my own first
2. A warning message for the Player alone "Get to Groundzero - You have 5 secounds!" - is that possible? i mean a message that only the player will see?
T i a,
simsalabim
-
simsalabim
- Lance Corporal
- Posts: 17
- Joined: Wed Jan 18, 2006 6:58 pm
Problem:
Any suggestions??
Thx in Advance,
simsalabim
Code: Select all
//initialising sound
local.master = spawn ScriptMaster
local.master aliascache fin_count sound/items/final_countdown.wav soundparms 0.7 0.0 1.0 0.0 10000 10000 local loaded maps "dm moh obj"
Want to play it here:
for(local.timer=0; local.timer<10; local.timer++)
{
if(local.p.origin[2] >= 20.0)
{
wait 1
local.p hurt 5.0 playsound fin_count // 1 hp per secound + play sound
if(local.timer < 1)
{
local.p iprint "I'm so n00bish u won't believe! :)" 1
local.p iprint "Whatever!" 1
}
}
}
Thx in Advance,
simsalabim
maybe:simsalabim wrote:Problem:
Any suggestions??Code: Select all
//initialising sound local.master = spawn ScriptMaster local.master aliascache fin_count sound/items/final_countdown.wav soundparms 0.7 0.0 1.0 0.0 10000 10000 local loaded maps "dm moh obj" Want to play it here: for(local.timer=0; local.timer<10; local.timer++) { if(local.p.origin[2] >= 20.0) { wait 1 local.p hurt 5.0 playsound fin_count // 1 hp per secound + play sound if(local.timer < 1) { local.p iprint "I'm so n00bish u won't believe! :)" 1 local.p iprint "Whatever!" 1 } } }
Thx in Advance,
simsalabim
Code: Select all
for(local.timer=0; local.timer<10; local.timer++)
{
if(local.p.origin[2] >= 20.0)
{
wait 1
local.p hurt 5.0 playsound fin_count // 1 hp per secound + play sound
if(local.timer =4)
{
local.p iprint "Get to Groundzero - You have 5 secounds!" 1 }
if(local.timer < 1)
{
local.p iprint "I'm so n00bish u won't believe! :)" 1
local.p iprint "Whatever!" 1
}
}
}
cant have spaces in ur thread name
Code: Select all
Want to play it here: -
simsalabim
- Lance Corporal
- Posts: 17
- Joined: Wed Jan 18, 2006 6:58 pm
Oh, lol, missunderstanding.
Want to play it here: isnt a thread...
What i meant was, that i cant get the sound to work.
Its not playing.
I used the ubersound-bypass by jv_map to work arround those tiki files, cuz i have no idea what they really are...
So there must be a syntax-error or something, when i try to play the sound in:
Sorry 
Want to play it here: isnt a thread...
What i meant was, that i cant get the sound to work.
Its not playing.
I used the ubersound-bypass by jv_map to work arround those tiki files, cuz i have no idea what they really are...
So there must be a syntax-error or something, when i try to play the sound in:
Code: Select all
local.p hurt 5.0 playsound fin_count-
simsalabim
- Lance Corporal
- Posts: 17
- Joined: Wed Jan 18, 2006 6:58 pm
Okay nevermind...
Sorted it out.
Did it!
Sorted it out.
Code: Select all
local.p hurt 5.0
local.p playsound fin_count
-
simsalabim
- Lance Corporal
- Posts: 17
- Joined: Wed Jan 18, 2006 6:58 pm
-
simsalabim
- Lance Corporal
- Posts: 17
- Joined: Wed Jan 18, 2006 6:58 pm

