Compass

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
newt

Compass

Post by newt »

Ok I need to know how to add a compass not on the hud but a object in the game. and it has to work. is there a way?

water that kills.... not on contact but no air =u die. explain.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

for the water, you could make a trigger under the water, so that the only way the player could touch it is with his head under water. then give the trigger a targetname in the editor and in script add this at the very very bottom of your script.

(this assumes the targetname of the trigger is "water")
(and that the game mode is sp)

Code: Select all

drown:

level waittill prespawn

local.doomsday = 0

while (self != NULL)
{
    wait 0.5
    if ($player istouching self)
    {
        local.doomsday++ //add one to the doomsday clock
    }

    if (local.doomsday >= 20) //thats at least 10 seconds under water
    {
        $player normal_damage 5
    }
}
end

and at the very top line of your script add this:

Code: Select all

$water thread drown
it's not fullproof, but its a start. :wink:
newt

Post by newt »

nice prolly be testing all this shit next week just gathering much as I can.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

newt wrote:nice prolly be testing all this crap next week just gathering much as I can.
You may want to use a more polite word here :roll: Remember Alcoholic wrote that sweet code for you.
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

You can make a compass in the game but how would you use it ? You can't pick it up and I don't think you could make a custom weapon for it to carry it around . In single player if you set an objective the hud compass can point to the current objective object you could put one at the north end of the map .
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

maybe he would, say have a compass on a moving truck, so you can see where north is, or something i dont know im too tired right now. :(
Post Reply