Jump to content

Light Step and Mine Timer?


HellFireXS

Recommended Posts

Is there a way to set Light Step up to directly affect the Explosion Timer of enemy mines instead of just setting the Mine Explosion Chance to 0?

 

I like the idea of Light Step I just don’t like that it doesn’t warn me an enemy mine is near.

 

As a temporary fix I simply set the Explosion Timer on mines to a high number so that I get virtually the same effect (they won’t explode) but it still beeps so I can find it. However this is less than ideal as mines I place won’t explode for enemies for that length of time.

Link to comment
Share on other sites

It might be simpler to write an object script attached to mines that plays a warning sound when you get within a certain range. if player.getdistance <= 32 playsound WatchOUT, sort of thing.

 

That would not cause your own mines to be less effective against NPCs, and wouldn't sound off for them either. Not that they would take heed anyway.

Link to comment
Share on other sites

I like that idea, is there a tutorial that covers adding scripts to objects?

If you are not familiar with creating scripts, then Cipsis has an excellent tutorial for that. I believe there are links to that and others pinned at the top of the page.

 

As for attaching the script to mines: once you have your object script saved, then edit the weapon under the object window ( i.e. WeapMineFrag ). The third box down from the upper left corner is SCRIPT. Select the name of your script to display there. Then all WeapMineFrags will run your script and alert you with whatever proximity alert sound that you have chosen. You can do the same thing with the other types of mines and traps as well.

Link to comment
Share on other sites

  • 1 month later...

Hmm, Player.GetDistance needs a Reference ID, I cant find a static one for Mines the only ones I can find are all different based on the 340 of MineFragProjectile's already in the world, and they aren't persistant, so I don't know what to do.

 

An alternate way would be to check if the player has Lightstep and if he does, then set the mine timer to a high number so it wont explode, but will still beep.

 

Please Help

Link to comment
Share on other sites

Hmm, Player.GetDistance needs a Reference ID, I cant find a static one for Mines the only ones I can find are all different based on the 340 of MineFragProjectile's already in the world, and they aren't persistant, so I don't know what to do.

 

An alternate way would be to check if the player has Lightstep and if he does, then set the mine timer to a high number so it wont explode, but will still beep.

 

Please Help

 

Maybe something like this, as an object script attached to the mine:

 

scn MineWarningSCRIPT

 

ref myself

short warning

 

Begin GameMode

 

set myself to GetSelf

 

if (player.GetDistance myself <= 50) && (warning == 0)

PlaySound QSTToneSequenceFail

set warning to 1

endif

 

if (player.GetDistance myself > 50) && (warning == 1)

set warning to 0

endif

end

 

Haven't tested this, but GetSelf is a handy way to create a variable reference.

 

The distance is just a number that I picked at random, and the "warning" is just to prevent the sound from playing repeatedly and continuously. Increasing the distance from the mine will reset warning so that the proximity alarm would work again. Disarming the mine and picking it up should remove it from the environment and effectively count as a greater distance, but I'm not certain about that. It might require some adjustment to reset the alarm.

Link to comment
Share on other sites

Thank you, I really appreciate your help, but I have a problem with the script.

 

"player.GetDistance myself" doesn't seem to be working (or it is working but not seeing my character as "myself") because nothing happens when I get near a mine, no sound at all... (I even tried removing the "player." before the "GetDistance myself" just in case but same result)

 

I tried just "getDistance player" but that didn't work either, it plays the warning but doesn't actually work as distance it seems, the warning plays once when I load (even when I am not near a mine) and wont play again I'm guessing the same thing would happen without a distance check.

Link to comment
Share on other sites

penny has the right idea hm..if its playing the warning sound at the load of the level, that means it is passing the conditional statement even when your that far away, makes sure your stating the player is WITHIN 50 and not OUTSIDE 50 units. also if it is playing only once the reset of the warning script is not getting accessed, go ahead and post your script and let me see what it looks like
Link to comment
Share on other sites

ok, after extensive testing, I'm pretty sure the GetSelf method is borked. The GetSelf is not setting the ref to the mine somehow, I dont know what the hell is happening to be honest. player.getdistance mine and mine.getdistance player should be the same, they are not as one passes the conditional and the other does not. it's documented that getself doesn't work right for items, and the distance is wonky too, so I guess we should rethink the method of alerting the player, unless someone can tell me a way of printing the return values to a screen/file so I can see exactly what values are being returned. I want to know what GetSelf is doing and what value the get distance mthod is returning, if I can see those values I'm sure I can make some sense of it.

 

penny's code would work in practice but in the game, the methods aren't doing their job I'm guessing

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...