Jump to content
Sign in to follow this  
Iceblade10

Game object problems

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

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

Recommended Posts

I'm trying to make a HUD for a SL based game I'm making, the problem I came across is, how would I go about making different damage types for a object? I'm trying to make 3 objects, a reaper, flame, and bandages, each respectively doing 100, 10, and, -100 damage, although from the script I have atm, I'm wondering if using llCollision is really the way.

integer energy;
default
{
state_entry()
{
energy=100;
llSetText((string)energy,<0,1,0>,1);
}
collision_start(integer x)
{
if(energy>0)
{
llCollisionFilter("pet",NULL_KEY,TRUE);
llSetText((string)energy,<0,1,0>,1);
energy = energy-10;
llSleep(1.0);
}
else
{
llSetText("Game Over!",<1,1,0>,1);
llSleep(4.0);
llResetScript();
}
}
}

 Studying some game objects from other sims, they all have scripts in each pickupable item, so I'm assuming they each have a string in them triggering the removal/increase of health in the HUD via a message when they are touched, I'm racking my brain trying to figure out, how will I get that to work.

 

so i have 2 possible methods

the collision filter method (which might not be possible according to some posts Ive seen)

and a object  communicating with the HUD

 

I rarely ever ask for help, but ths has been bugging me for the longest time now

Share this post


Link to post
Share on other sites

Why not just make each object a vendor?  A person can't just take the object, but has to click on the vendor to get a copy.  Rig it so that the act of clicking also sends a chat message with llRegionSayTo on a high negative private channel.  The HUD receives the message and downgrades the person's health score.

Share this post


Link to post
Share on other sites

Instead of collisions sometimes Volume Detect is used. I know this due to an extremely obvious use for my chosen past time in SL....you can walk right through it and it records you passed through..among a few other things. I can't remember the exact use and function name, but Volume Detect is maybe a good starting point. Of course, the wiki helps here...as usual!

Share this post


Link to post
Share on other sites

When a collision is made have the hit item say 'something' and the hud will listen for this 'something' and do what you script it to do upon hearing that 'something'.

Share this post


Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 3285 days.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...