
casual mods
Joined: May 2, 2013
I be chillin
|
Posted: Jun 4, 2013 02:30 PM
Msg. 1 of 5
can someone give me an example or explain how a points script would work?
im making a singleplayer map similar to the flash game storm the house i need it to add points when an enemy dies.
|
|
|

kirby_422
Joined: Jan 22, 2006
Apparently public enemy number 1?
|
Posted: Jun 4, 2013 08:03 PM
Msg. 2 of 5
(global short points 0) (global short living 0) (script continuous add_points (sleep_until (!= living (ai_living_count random_encounter)) 5) (if (> living (ai_living_count random_encounter)) (set points (+ points (- living (ai_living_count random_encounter)))) ) (set living (ai_living_count random_encounter)) ) If the amount that you previously knew was alive isnt equal to the current amount alive, check if it increased or decreased. If it decreased, add the difference to your points. Set the known living count to the current living count. This allows it to increase via you adding more on the ground with ai_place.
|
|
|

Stevedoggen
Joined: Jan 14, 2013
#Byf4Lyf
|
Posted: Jun 4, 2013 11:58 PM
Msg. 3 of 5
Out of curiousity, how would one make a custom point counter onscreen to show that number? Do you know?
|
|
|

kirby_422
Joined: Jan 22, 2006
Apparently public enemy number 1?
|
Posted: Jun 5, 2013 12:24 AM
Msg. 4 of 5
you can use cinematic titles, for each number of each digit place. Or, if you can accept them being on the left half side in console font, merely (inspect <global-name>), and (cls) to remove it eg, (script continuous display_points (set developer_mode 127) ;;Just so all console info prints without hinderance (cls) ;;Clear any console text (inspect points) ;;Display global as console text (sleep 10) ;;Delay 1/3rd of a second before repeating. ) This assumes you toss it beneath the other script here (ie, you already have the variable points)
|
|
|

Stevedoggen
Joined: Jan 14, 2013
#Byf4Lyf
|
Posted: Jun 5, 2013 03:55 AM
Msg. 5 of 5
That's pretty neat. Thanks. I wondered how Gamma (?) did it in his hub game thing video
|
|
|