Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
CaptainManiac

Pls it is urgent,help me plssss

Question

actor JetThruster : CustomInventory 11000

{

  Inventory.PickupMessage "Jet Thruster!"

  Inventory.Amount 1

  Inventory.MaxAmount 5

  Inventory.PickupSound "misc/p_pkup"

  Inventory.UseSound "misc/jetthruster"

  Inventory.Icon "ARTIJET"

  +INVENTORY.FANCYPICKUPSOUND

  +INVBAR

  +COUNTITEM

  states

  {

  Spawn:

    JETT A -1

    Stop

  Use:

    TNT1 A 0 A_JumpIf(GetPlayerInput(-1,BT_USE) & CheckInventory("PowerFlymo",1),"Fail")

    TNT1 A 0 A_GiveInventory("PowerFlymo",1)

    loop

  Fail:

    TNT1 A 0 A_JumpIf(GetPlayerInput(-1,BT_USE) & CheckInventory("PowerFlymo",0),"Use")

    TNT1 A 0 A_TakeInventory("PowerFlymo",1)

    loop

  }

}

 

So,i tried to make this a constant jetpack as i planned(originally a 1 minute jetpack for use only once) and when i try to run in Zandronum it gives me very fatal error with Calling unknown ACS FUnction GetPlayerInput and in GZDOOM latest version,Sprite Names Must be Exactly 4 characters on a line where is a state name.Whyyy?

 

I tried to modify it from Realm667 to make it better,so why is that?

Pleaseeeeeeeee,idk why,it comes to that shit,plsss help meee

Share this post


Link to post

12 answers to this question

Recommended Posts

  • 0

CheckInventory and TakeInventory are written in different form in ACS, and there's no need for that == 1.

 

If( (GetPlayerInput(-1, INPUT_BUTTONS) & (BT_USE)) && ( (CheckInventory("PowerFlymo")) == 0) )

{
GiveInventory("PowerFlymo",1);
}

else

If( (GetPlayerInput(-1, INPUT_BUTTONS) & (BT_USE)) && ( (CheckInventory("PowerFlymo")) == 1) )

{

TakeInventory("PowerFlymo",1);

}

 

Share this post


Link to post
  • 0

Tested on GZDoom

 

actor JetThruster : CustomInventory 11000

{

  Inventory.PickupMessage "Jet Thruster!"

  Inventory.Amount 1

  Inventory.MaxAmount 5

  Inventory.PickupSound "misc/p_pkup"

  Inventory.UseSound "misc/jetthruster"

  Inventory.Icon "ARTIJET"

  +INVENTORY.FANCYPICKUPSOUND

  +INVBAR

  +COUNTITEM

  states

  {

  Spawn:

    JETT A -1

    Stop

  Use:

    TNT1 A 0
    {
     If( (GetPlayerInput(-1,BT_USE)) & (CountInv("PowerFlymo") > 1) )
     {
      A_Jump(256,"Failure");
     }
    }
    TNT1 A 0 A_GiveInventory("PowerFlymo",1)

    loop

  Failure:

    TNT1 A 0
    {
     If( (GetPlayerInput(-1,BT_USE)) & (CountInv("PowerFlymo") < 1) )
     {
      A_Jump(256,"Use");
     }
    }
    TNT1 A 0 A_TakeInventory("PowerFlymo",1)

    loop

  }

}

Share this post


Link to post
  • 0
Just now, dmg_64 said:

Nope, AFAIK Anonymous Functions aren't supported in the current Zandronum version.

Then Hiw the Hell it wil work on Zandro?What to do?

Share this post


Link to post
  • 0

One way I got around this issue is by using ACS scripts instead, ACS_ExecuteAlways and CheckInventory on a script and the conditions are handled there rather than the pickup itself.

 

eg:

 

TNT1 A 0 ACS_ExecuteAlways(yourscriptnumber)

actual script code

If(CheckInventory("PowerFlymo"))

{

TakeInventory("PowerFlymo",1);

}

 

Share this post


Link to post
  • 0
2 minutes ago, dmg_64 said:

One way I got around this issue is by using ACS scripts instead, ACS_ExecuteAlways and CheckInventory on a script and the conditions are handled there rather than the pickup itself.

 

eg:

 


TNT1 A 0 ACS_ExecuteAlways(yourscriptnumber)

actual script code


If(CheckInventory("PowerFlymo"))

{

TakeInventory("PowerFlymo",1);

}

 

So,to make two scripts one which gives and other which fails?And without keycodes where exactly to put them?so,in the fail state to be something that can give the inventory item back?

Share this post


Link to post
  • 0

Yes that should work, or you could just use 1 script with an argument (int something) that determines the option the script would go with so you can have a script perform two or more different things.

Share this post


Link to post
  • 0

script NUMBER (int condition)

{

 If(condition == 0)

 {

 //Do something

 }

else

 If(condition == 1)

 {

 //Do something else

 }

//You can add more if you wish

}

 

and in your actor states you would change your script first argument based on the result you want to get:

 

Use:

TNT1 A 0 A_JumpIfInventory("PowerFlymo",1,"Failure")

TNT1 A 0  ACS_ExecuteWithResult(NUMBER, your_condition_number_here,0,0,0)

 

Failure:

TNT1 A 0  ACS_ExecuteWithResult(NUMBER, your_other_condition_number_here,0,0,0)

Share this post


Link to post
  • 0

script 12 (int usekey)
{
 usekey = GetPlayerInput(-1,BT_USE);
 If(usekey == 1 & CheckInventory("PowerFlymo",0) == 1)

{
GiveInventory("PowerFlymo",1);
}

else

 If(usekey == 1 & CheckIventory("PowerFlymo",1) == 1)

{
TakeInventory("PowerFlymo");
}

//You can add more if you wish

}

 

where is my mistake?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×