Jump to content

Collecting Counter script - Need srs help...


Walter Fanwood
 Share

You are about to reply to a thread that has been inactive for 2421 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

 

Well im pretty much building along the last times in SL but i have a lil problem coz i really dont know how i could create that.

 

I try to create some thing like a collecting hud, a simple one, like you collect coins or like.

 

Let me explain myself what i tried but sadly failed.

It sure is for a kind of game where the "Player" should collect a special number of, let me use as sample, Coins to win the game. So What i want (and i guess need...) is that this said Object reacts to the player and adds "1 Point" (as sample) to the hud the player is wearing.

 

As example, try to image something like a simple Ring our coin counter from the Sonic or mario games. Thats kinda all i want.

 

But insteed of numbers, i wana use textures which would be simple named by

"Coin00" up to "Coin10"

 

So everytime you collect such "coin" the counter should rise a number, so changing the texture by one ("Coin00","Coin01","Coin02" and so on). The object sure should disapier if you touched/collect it.

If the player got 10 coints, the hud should say something like "You WIN!" and reset the counter after maybe 5 Seconds - same if you detach the hud that the counter resets to "0".

 

I duno if thats possible but my scripting experience didnt helped me. I would be really thankful if someone may could help me with if not maybe even create this easy stuff/scripts (heh, said by the one who cant create them...<<; ) since textures are not a problem for me to create. Only this....both scripts (i think i need 2 coz one for the object to collect and one for the hud)....i really tried now 3 month but i gave up... -.-

Link to comment
Share on other sites

You need some chatting between the Coin and the HUD and vice versa.

By touching the coin, the script will know the touching agents ID. So you are able to send a llRegionSayTo() message to the touching agent. On a non-zero channel, the HUD will receive this message in a listen event and can count the coin, display a texture etc.. From the HUDs listen event you got the ID of the coin, with which you can send back a message from the HUD to the coin, again with llRegionSayTo(), on the channel the coin has set up a listen. To confirm that the HUD got the coin and that the coin can delete itself.

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2421 days.

Please take a moment to consider if this thread is worth bumping.

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
 Share

×
×
  • Create New...