Jump to content

Show icon when somone is typing.....


DazzaJay

Recommended Posts

  • Replies 134
  • Created
  • Last Reply

Top Posters In This Topic

Posted
I've got it working on my server right now. I think I'll post the code when I get a chance, since I'm sure it's horribly inefficient right now, and I wouldn't mind a couple more eyes checking my code

Thats kinda weird, seeing as isChatBoxInputActive() does not work in DP2 :)

Are you having us on :P

*edit*

Pics or it didnt happen

Posted
Try http://www.fileden.com/files/2006/10/16/292619/tryme.rar. It works for me :)
Thats kinda weird, seeing as isChatBoxInputActive() does not work in DP2 :)

It works for me. Want a screen? :P

Well, i have tested yours, but there is a small bug i have found.

ok, if somone is Off screen when they start typing, and you turn to look at them, they dont have the icon above thier head.

like, it only places the icon above peoples heads when they start typing and they are seen in your screen area.

if you njeed me to go in better details, i can film a vid.

Posted

There needs to be a timer. I guess there must be only key binding. Timer is needed to update players' screen.

Posted

Dazza, ive made my own now, it supports:

- Fading the icon in and out as a player starts to chat and stops chatting

- Distance between players effects the size of the icon

- Icons are linked to your FPS, so they do not lag around.

- Icons are not displayed if the element is not on the screen.

I shall give it to you shortly, do u have MSN?

Posted

Yeah man, MSN, ICQ, AIM, Y!, Google Talk, Xfire.... i got them all.

they should appear under my name in the left block

<------

Also, if somone starts typing Off-Screen, and then you come into visual range of them, will the icon appear?

Posted
ömm, AlienX why are you dont uppload this? for all peaple

He has a point you know... Cause it sounds better then my 10 minutes of work...

Oh and someone asked why I said it was a gamemode in the meta.xml: I couldn't get the icon.png to work without doing so (for some weird reason).

Posted (edited)
Thats odd, cos i changed your meta.xml from gamemode to script and it worked fine.

It would just give me a error about there being no src attribute for the file (while there is). Edit works now.

Edit (2): Try this, it should do everything AlienX's does except for the fade in and out (it just appears and disappears).

Edit (3): Changed the above again.

Edit (4): processLineOfSight doesn't really work well... or I just used it wrong -.-

Edited by Guest
Posted

Edit (2): Try this, it should do everything AlienX's does except for the fade in and out (it just appears and disappears).

nice! this is near perfect for me, but it is possibly that the icon don´t show through the objects and don´t show when the player are crawling?

Posted
nice! this is near perfect for me, but it is possibly that the icon don´t show through the objects and don´t show when the player are crawling?

Redownload, and replace

function updatep() 
    local players=getElementsByType("player") 
    for index,player in ipairs(players) do 
    if (timer[player]==true) then 
        local cx,cy,cz = getCameraPosition() 
        local px,py,pz = getElementPosition(player) 
        local distance = getDistanceBetweenPoints3D(cx,cy,cz,px,py,pz) 
        if (processLineOfSight ( cx, cy, cz, px, py, py, true, false, false, true, false, false, false, false, nil ) == false) then 
            if (distance<=160) then 
                if (distance <= 20) then 
                    size=1 
                else 
                        size=20/distance 
                end 
                local sx,sy = getScreenFromWorldPosition(px,py,pz+0.
                if (sx and sy) then 
                    image[player] = guiCreateStaticImage(sx,sy-(49*size),49*size,49*size,"img/icon.png",false,nil) 
                    if (image[player]) then 
                        destroyElement(image[player]) 
                    end 
                end 
            end 
        end 
    end 
    end 
end 

with

function updatep() 
    local players=getElementsByType("player") 
    for index,player in ipairs(players) do 
    if (timer[player]==true) then 
        local cx,cy,cz = getCameraPosition() 
        local px,py,pz = getElementPosition(player) 
        local distance = getDistanceBetweenPoints3D(cx,cy,cz,px,py,pz) 
        if (processLineOfSight ( cx, cy, cz, px, py, py, true, false, false, true, false, false, false, false, nil ) == false) then 
            if (isPlayerDucked(player)==false) then 
                if (distance<=160) then 
                    if (distance <= 20) then 
                        size=1 
                    else 
                            size=20/distance 
                    end 
                    local sx,sy = getScreenFromWorldPosition(px,py,pz+0.
                    if (sx and sy) then 
                        image[player] = guiCreateStaticImage(sx,sy-(49*size),49*size,49*size,"img/icon.png",false,nil) 
                        if (image[player]) then 
                            destroyElement(image[player]) 
                        end 
                    end 
                end 
            end 
        end 
    end 
    end 
end 

Posted

Strange the icon doesn't show in my edited version of CDM but when i load broph it works fine.

The only error i have is this one but i had this one longer

[19:35:11] ERROR: Couldn't packetize argument list, invalid element specified. 

Posted
[19:35:11] ERROR: Couldn't packetize argument list, invalid element specified. 

I myself would ignore that error, as i get that on a Default install of the server, Without any extra Scripts running.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...