Advertisement
skroton

other projectile things for anon

Jun 12th, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.60 KB | None | 0 0
  1. /* place the following in your acs, outside of any scripts */
  2.  
  3. global int 51:g_51[];  /* 0-63 = Player TIDs */
  4.  
  5. /* script to assign unique tid to player on map enter, constant loop to ensure player is only thing thing with tid */
  6. script "player_tid" ENTER /* player tid script */
  7. {
  8.   int player_num, cur_tid, new_tid; /* player number, current tid, new tid */
  9.  
  10.   while(true){ /* script will loop continuously */
  11.     player_num = PlayerNumber(); /* get player number */
  12.     cur_tid = ActivatorTID(); /* get player current tid */
  13.     if(!faction_a[player_num] /* IF there's no value for the player tid in the array */
  14.      ||  !ActivatorTID() /* OR the player currently has no tid or tid is 0 */
  15.      || ThingCount(T_NONE,cur_tid) > 1){ /* OR more than one thing has the same tid as the player */
  16.       new_tid = UniqueTID(); /* get a new unique tid */
  17.       g_51[player_num] = new_tid; /* put it in the array */
  18.       Thing_ChangeTid(0, new_tid); } /* give the player the new tid */
  19.     delay(1); } /* 1 tic delay for loop, means we can be somewhat sure players tids won't have issues */
  20. }
  21.  
  22. /* call this script from the bowl actor */
  23. script "proj_assign" (void) /* since this is called from the actor, the activator is the bowl actor */
  24. {
  25.   int play_tid; /* the player's tid */
  26.   play_tid = GetActorProperty(0, APROP_TargetTID); /* get the tid of the projectile's target, which is the player */
  27.   /* now do the things you want to do in the script, using tid of "0" to refer to bowl actor (since the bowl actor activated the script), and tid of "play_tid" to refer to the player that fired the projectile */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement