Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
killlvz

 
Post new topic   Reply to topic Printable version
 View previous topic  Spree module Post :: Post Galactic Empire project  View next topic  
Author Message
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Wed Mar 28, 2007 6:11 am    Post subject: killlvz Reply to topic Reply with quote

I really hate kill lvz that obscure my view, like covering my ship or some giant blood splat. Anyway I was reading this thread Image random changing and thought I should just make it in py to show how easy it is.

If you didn't read the thread this module will toggle a random image on when a player dies.

Here is the entire code with useless stuff removed:
Code: Show/Hide
# change these settings, the range is inclusive
ImageRangeMin=200
ImageRangeMax=202

from asss import *
objs = get_interface(I_OBJECTS)
prng = get_interface(I_PRNG)

def kill(arena, killer, killed, bty, flags, pts, green):
    randomid = prng.Number(ImageRangeMin, ImageRangeMax)
    objs.Toggle(killed, randomid, 1)
    return pts, green

def mm_attach(arena):
    arena.killlvz_ref1 = reg_callback(CB_KILL, kill, arena)

def mm_detach(arena):
    arena.killlvz_ref1 = None


I've attached the full code zipped with an example .lvz.
_________________
ss news




py + lvz

killlvz.zip - 5.75 KB
File downloaded or viewed 45 time(s)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
laww
Newbie


Age:41
Gender:Gender:Male
Joined: Mar 22 2007
Posts: 10
Offline

PostPosted: Wed Mar 28, 2007 8:46 am    Post subject: Reply to topic Reply with quote

thanks alot... btw is there a way you can make it when someone kill and a image pop up also?
Back to top
View users profile Send private message Add User to Ignore List
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Wed Mar 28, 2007 10:34 am    Post subject: Reply to topic Reply with quote

Yeah that can be done by copy/pasting some code, renaming ImageRangeMin/ImageRangeMan and editing killed to be killer.
Code: Show/Hide
# change these settings, the range is inclusive
ImageRangeKilledMin=200
ImageRangeKilledMax=202

ImageRangeKillerMin=200
ImageRangeKillerMax=202

from asss import *
objs = get_interface(I_OBJECTS)
prng = get_interface(I_PRNG)

def kill(arena, killer, killed, bty, flags, pts, green):
    randomid = prng.Number(ImageRangeKilledMin, ImageRangeKilledMax)
    objs.Toggle(killed, randomid, 1)
    randomid = prng.Number(ImageRangeKillerMin, ImageRangeKillerMax)
    objs.Toggle(killer, randomid, 1)
    return pts, green

def mm_attach(arena):
    arena.killlvz_ref1 = reg_callback(CB_KILL, kill, arena)

def mm_detach(arena):
    arena.killlvz_ref1 = None
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 681 page(s) served in previous 5 minutes.

phpBB Created this page in 0.386514 seconds : 30 queries executed (92.9%): GZIP compression disabled