Blender game help with point system

Hi, I need help on my fps where there is a survival mode and I want to make it that every 100 points it refills your ammo.
Does anyone know how to do this? If I can do it without python that would be awesome, but if python is required, than that’s okay too. (:

Hi I hope you are having a good day.

If you were to use python your code coud look sonething like this.

if lifepionts == 100
ammo = maximum

but I can’t tell for sure unless I see the blend file.

I Hope it helps.

Depends on how you count points and how you deal with ammo.

Dirty method:

Property sensor Mode: equal; Property: points; Value: 100
-> AND
–> Property Actuator Mode assign; Property: Ammunition; Value: 20

Better method
These things usually do not belong together. This means the property with points and the property of ammunition belong sto different objects. So it would be hard to connect them together.

In this relative simple case you can communicate via messages:

Point counter:
Property sensor Mode: equal; Property: points; Value: 100
-> AND
–> Message Actuator Subject:“refill”

Ammunition counter:
Message Sensor Subject:“refill”
-> AND
–> Property Actuator Mode assign; Property: Ammunition; Value: 20

I hope it helps

That’s not quite what I meant, what I meant was that every time I gained 100 new points I get ammo, 100 points adds ammo, 200 points adds ammo, 300 points adds ammo, and so on.


points_last = 0

points_for_clip = 100
new_clip = 30

def add(cont):
    global points_last
    
    own = cont.owner
    
    points_now = own["points"]
    points_delta = points_now - points_last
    
    if points_delta > points_for_clip:
        own["ammo"] += new_clip
        points_last = points_now

Example attached.

Attachments

points_ammo.blend (427 KB)

sorry my bad!

Thank you very much!! This worked!