HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How do you do stealth properly?

06-28-2005, 01:23 AM#1
Guest
I'm currently working on a marine map (yes, another one) with the working title Special Forces. It's a multiplayer map with two squads of Special Forces members, each with their own individual specialties. One squad has to infiltrate the terrorist base and steal files while the other squad has to create a diversion by setting off some of the terrorists' spare bombs. There's a major plot twist too, but I don't want to reveal that yet :) .

Anyways, with the first squad I'm trying to do a kind of Splinter Cell/Metal Gear Solid type of gameplay, with sneaking past patrolling guards and whatnot. Problem is, I don't know how to do it right. I need to know what the best way to do this would be. I've been brainstorming for a few hours, but nothing comes to mind aside from "If unit is within 100, attack unit" triggers. Got any good ideas?
06-28-2005, 02:56 PM#2
Tim.
You can do a loop. Example:

Code:
Stealth Events
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 50, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Distance between (Position of PlayerUnit[1]) and (Position of DefenceUnit[(Integer A)])) Less than or equal to 300.00
                    Then - Actions
                    Else - Actions
                        Do nothing

This of course would work for 50 guard units, but you would simply need to edit that value to the exact amount you have.

Note: This also refers to only one player control unit. the [1] however refers to the player number.
06-30-2005, 01:46 AM#3
Guest
Looks pretty good. I'll try it out. Anyone else got any good ideas?
06-30-2005, 02:05 AM#4
Ceo
After he is within range of a defense unit create a periodic trigger for the defense unit that checks if the angle from the defense unit to the stealth unit is within (facing angle of defense unit + ~45 and - ~45) and slowly turns the defense unit towards the stealthed unit. Only make him set off the alarm if he the facing check passes.
06-30-2005, 02:48 AM#5
Guest
That's cool. That's what I was looking for. Any way to make the cone show on the minimap or on screen?
06-30-2005, 02:56 AM#6
Gurrgel
Don't want to steal this topic or anything, but I've been trying to make a trigger that makes enemies detect a stealthed unit if it stays within a certain (like 500) range for over 10 seconds, the only thing I've managed to do so far is a trigger that would cause a whole lot of lag, so if anyone has any ideas for a simple way to do this, that would be great.

The Stealthed unit will be alone, and the enemies will be up to 11 other players each controlling 1 unit.
07-01-2005, 02:18 AM#7
Guest
Well, you might have tried this, but maybe you could do something like:
If enemy is within 500
set variable to 1
Else set variable to 0
wait 10 seconds
If variable is equal to 1
make Hero visible

maybe something like that??? The code is loose; I don't have world edit open.
07-01-2005, 11:11 AM#8
Gurrgel
Quote:
Originally Posted by spacepirate09
Well, you might have tried this, but maybe you could do something like:
If enemy is within 500
set variable to 1
Else set variable to 0
wait 10 seconds
If variable is equal to 1
make Hero visible

maybe something like that??? The code is loose; I don't have world edit open.

I've got to run the trigger for 9 different units/players at a time, wouldn't the wait time make that pretty bad?

Currently I've got a trigger that runs every second, I've got an int variable for each unit, and whenever the trigger runs, all of these integers are lowered by 1, then increased by 2 if the unit is within range, however, I've got a lot of loops, and I get the feeling that this will cause a lot of lag, on the other hand, I've only got like 20 units on the map at the same time (with summons and stuff) so I'm not sure if these loops (mostly pick every unit in playable map area) are any real trouble, I've usually only made more regular melee maps (with some custom stuff) and in those cases running a loop every second that picks every unit in the map area would be a lot worse...

Maybe I will just optimize my trigger, I'm sure I can make it a lot shorter...

Also, does anyone know if the abilities used to detect invisiblity can be changed not to detect burrowed units, I know you can select them only to detect invisible units, but I've heard that it doesn't work, and I'm not at home right now, so I can't check it myself...