Page 1 of 2

Script request

Posted: Fri Aug 12, 2016 8:28 am
by Billy
I need a script that sets start equipment to a pillow and doesn't allow to change weapons.
If a player throws a pillow, he cant attack until he grabs another one.
Pls tell me if you got any questions
PS.: you will get a small shiny credit in my map ;)
 ! Message from: KliPeH
The poster was issued a warning for breaking the following forum rule:
Rule #10 - Post descriptive topic titles.

EDIT: The player should be able to attack while holding a pillow, otherwise he might deal no damage or something like that.

Re: Script request

Posted: Fri Aug 12, 2016 10:44 am
by Creeper
One thing with the throwing thing, You can only freeze them, Soooo they "Can't" melee, But they cant move. So this is a big problem for you.
And if you make them get the pillow, when the they threw it, Its going to be realy unbalanced for others.
I don't think that there is a script for disabling melee and the player could still move.
But im not a script professionalist so you can wait until a different scripter comes here and tells you what to do. :3

Re: Script request

Posted: Sat Aug 13, 2016 3:28 pm
by Billy
Off Topic
I need the script really badly(this text is in a offtopic bubble cause i cant get banned for comments in those little useful helpers :D )

Re: Script request

Posted: Sun Aug 14, 2016 3:33 pm
by JakSparro98
Billy wrote:I need a script that sets start equipment to a pillow and doesn't allow to change weapons.
If a player throws a pillow, he cant attack until he grabs another one.
Pls tell me if you got any questions
PS.: you will get a small shiny credit in my map ;)
 ! Message from: KliPeH
The poster was issued a warning for breaking the following forum rule:
Rule #10 - Post descriptive topic titles.

EDIT: The player should be able to attack while holding a pillow, otherwise he might deal no damage or something like that.
As how I have understood the script do these operations:
  • • Assign pillows at start, when dropped and don't allow the player to use other weapons, but powerups still works.

    • fists aren't selectable.

    • kicks don't hurts but fall damage caused by flying kicks still do.
If you need other tweaks let me know.

Re: Script request

Posted: Sun Aug 14, 2016 6:15 pm
by Billy
Off Topic
yes, exactly

Re: Script request

Posted: Sun Aug 14, 2016 6:50 pm
by JakSparro98
Here's to you:

Code: Select all

Events.UpdateCallback m_updateEvent = null;
int[] playersUID=new int[8];
int index=0;

 public void OnStartup() {
    m_updateEvent = Events.UpdateCallback.Start(PillowScript, 0);
 }

public void PillowScript(float elapsed) {

foreach(IObject destroyer in Game.GetObjectsByName("Pillow00"))
   if(!destroyer.IsMissile)
   destroyer.Remove();

foreach(IPlayer pl in Game.GetPlayers())
{
   if(!pl.IsBot)
   {
      if(pl.CurrentWeaponDrawn.ToString()!="Melee" || pl.CurrentMeleeMakeshiftWeapon.WeaponItem.ToString() !="PILLOW")
      if((pl.IsIdle && !pl.IsRolling)|| pl.IsMeleeAttacking || pl.IsDrawingWeapon)
      pl.GiveWeaponItem(WeaponItem.PILLOW);
   }

   if(pl.IsStaggering &&!playersUID.Contains(pl.UniqueID))
   {
   playersUID[index]=pl.UniqueID;
   index++;
   pl.SetHealth(pl.GetHealth()+3);
   }

   if(!pl.IsLayingOnGround && !pl.IsStaggering && playersUID.Contains(pl.UniqueID)&& !pl.IsFalling)
   playersUID[Array.IndexOf(playersUID,pl.UniqueID)]=0;
   
   if(index>=7)
   index=0;
}

}
You don't need to place triggers to get this to work, It will run at the map startup.

Re: Script request

Posted: Mon Aug 15, 2016 3:46 pm
by Billy
Off Topic
THX MAN
Added in 6 hours 16 minutes 6 seconds:
i found a bug in the script, if you get stunned you spawn a constant stream of pillows

Re: Script request

Posted: Mon Aug 15, 2016 4:23 pm
by JakSparro98
Billy wrote:
Off Topic
THX MAN
Added in 6 hours 16 minutes 6 seconds:
i found a bug in the script, if you get stunned you spawn a constant stream of pillows
Fixed, I've updated the code above.

Re: Script request

Posted: Tue Aug 16, 2016 5:17 pm
by Billy
Ok, you will get two credits

Added in 23 hours 28 minutes 50 seconds:
you said if i nnedd other changes, i should let you know.
I also need the aspect to don't be able to select ANY other weapon then pillows.(ya will get credit no' 4)

Re: Script request

Posted: Tue Aug 16, 2016 9:04 pm
by JakSparro98
Billy wrote:Ok, you will get two credits

Added in 23 hours 28 minutes 50 seconds:
you said if i nnedd other changes, i should let you know.
I also need the aspect to don't be able to select ANY other weapon then pillows.(ya will get credit no' 4)
I didn't understand what you asked, you want to collect weapons but don't be able to select instead of removing them from the inventory?

Re: Script request

Posted: Wed Aug 17, 2016 8:52 am
by Billy
Removing is also a good idea, but if the script includes that, it doesn't work.

Re: Script request

Posted: Wed Aug 17, 2016 12:05 pm
by JakSparro98
Ok now you collect weapons but you cannot use them.

Re: Script request

Posted: Fri Aug 19, 2016 9:53 am
by Billy
sorry i have to annoy you again: what about melee weapons? they still deal damage...
doo you need one more credit for that?

Re: Script request

Posted: Fri Aug 19, 2016 12:26 pm
by JakSparro98
Billy wrote:sorry i have to annoy you again: what about melee weapons? they still deal damage...
doo you need one more credit for that?
No problem, you don't need to credit me (if credit means that you write my name in your maps' developers) each time you tell me to correct the code, one time is enough.

Also thanks for this reports, I fixed this.

Re: Script request

Posted: Fri Aug 26, 2016 9:52 am
by Motto73
JakSparro98 wrote:
Billy wrote:sorry i have to annoy you again: what about melee weapons? they still deal damage...
doo you need one more credit for that?
No problem, you don't need to credit me (if credit means that you write my name in your maps' developers) each time you tell me to correct the code, one time is enough.

Also thanks for this reports, I fixed this.
For me that is zero.

Re: Script request

Posted: Fri Aug 26, 2016 4:22 pm
by Billy
I know, Motto, but i got a script from HIM first so... I will might ask both of you in the future and see who deliveres a better one.

Re: Script request

Posted: Mon Aug 29, 2016 1:38 pm
by Motto73
Billy wrote:I know, Motto, but i got a script from HIM first so... I will might ask both of you in the future and see who deliveres a better one.
I said that for Jack actually.
Billy wrote:... and see who deliveres a better one.
You think that we are some kind of pizza deliveries???
Of course we are helping to improve the game and the community. But you can't take us for granted.

Re: Script request

Posted: Tue Aug 30, 2016 9:03 pm
by Billy
I know, but well... in my country "delivers" is just a therm you can use for everything whithout any "rules" like in english, cause there is not an other word for it, so SORRY

Re: Script request

Posted: Tue Aug 30, 2016 9:51 pm
by JakSparro98
Motto73 wrote:
JakSparro98 wrote:
Billy wrote:sorry i have to annoy you again: what about melee weapons? they still deal damage...
doo you need one more credit for that?
No problem, you don't need to credit me (if credit means that you write my name in your maps' developers) each time you tell me to correct the code, one time is enough.

Also thanks for this reports, I fixed this.
For me that is zero.
Yeah, this won't change my life but if he wanted to credit me...well, one time because more times doesn't make sense, even nothing but he's free to do all he want.

Re: Script request

Posted: Wed Aug 31, 2016 8:13 am
by Billy
No, you only got two credits cause you dont need more than one: one nexg to my name and one is hidden