[ACS] Dropping a flag via script?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
FranckyFox2468
Forum Regular
Posts: 180
Joined: Sat May 07, 2016 8:30 pm

[ACS] Dropping a flag via script?

#1

Post by FranckyFox2468 » Wed Aug 30, 2017 8:39 pm

Hey, just wanted to drop a little question like that. Is it possible to make an item (like a powerup) make the player drop a currently held CTF flag and perhaps forbidding a flag to be picked up for as long as said item is in the inventory?

Basically what i am trying to recreate is a similar effect to perhaps tf2's bonk soda or an ubercharge where invincibility makes the player drop a flag to avoid unfair advantage.

User avatar
Ivan
Addicted to Zandronum
Posts: 2219
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

[ACS] Re: Dropping a flag via script?

#2

Post by Ivan » Wed Aug 30, 2017 8:41 pm

I don't think that's possible but I could be wrong, never messed with those before.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
jdagenet
Forum Regular
Posts: 191
Joined: Tue Jun 05, 2012 8:08 am
Clan: Cube
Clan Tag: A3
Contact:

[ACS] Re: Dropping a flag via script?

#3

Post by jdagenet » Wed Aug 30, 2017 10:24 pm

Whenever you pickup the powerup, you could call A_DropItem (or have the powerup execute a script that drops the item, your call) and just drop the flag if the player is holding one. The problem you might run into is how the gamemode will behave if you do drop the flag outside how a flag is typically dropped. It might act as accordingly or it might just mess up entirely, not sure.
<Dynamo_>uh
<Dynamo_>did you just take the thread away
<FusedQyou>Dunno
<FusedQyou>ask the thread

User avatar
Combinebobnt
Retired Staff / Community Team Member
Posts: 1893
Joined: Mon Jun 04, 2012 3:37 am
Location: Erth
Contact:

[ACS] Re: Dropping a flag via script?

#4

Post by Combinebobnt » Thu Aug 31, 2017 5:50 am

Make your own flag and don't use some carnevil inflexible hardcoded shit. This is what deathball is all about (you can shoot the ball(flag) at other ppl!!!).

User avatar
FranckyFox2468
Forum Regular
Posts: 180
Joined: Sat May 07, 2016 8:30 pm

[ACS] Re: Dropping a flag via script?

#5

Post by FranckyFox2468 » Sat Sep 02, 2017 5:43 pm

Combinebobnt wrote:Make your own flag and don't use some carnevil inflexible hardcoded shit. This is what deathball is all about (you can shoot the ball(flag) at other ppl!!!).
What's wrong with carnevil's stuff?

Also i'm mainly asking cause i intend to maybe have some characters with temporary invincibility and i don't want them to just run away with the flag without being able to be stopped.

User avatar
Ivan
Addicted to Zandronum
Posts: 2219
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

[ACS] Re: Dropping a flag via script?

#6

Post by Ivan » Sat Sep 02, 2017 7:00 pm

FranckyFox2468 wrote:
Combinebobnt wrote:Make your own flag and don't use some carnevil inflexible hardcoded shit. This is what deathball is all about (you can shoot the ball(flag) at other ppl!!!).
What's wrong with carnevil's stuff?
It's hardcoded (and coded terribly) mess. I've spent years of my modding just working around shit he hardcoded just to achieve trivial things like the one you're asking for in this thread.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
FranckyFox2468
Forum Regular
Posts: 180
Joined: Sat May 07, 2016 8:30 pm

[ACS] Re: Dropping a flag via script?

#7

Post by FranckyFox2468 » Sat Sep 09, 2017 3:21 pm

Combinebobnt wrote:Make your own flag and don't use some carnevil inflexible hardcoded shit. This is what deathball is all about (you can shoot the ball(flag) at other ppl!!!).
...i just realized tho, if you use a custom built flag, how do you handle the announcer and the game telling everyone the flag has been taken?

Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

[ACS] Re: Dropping a flag via script?

#8

Post by Konda » Sat Sep 09, 2017 3:38 pm

The flag will have to inherit from CustomInventory, which will enable you to have a Pickup state label in its decorate which gets executed when the item is picked up. Then from the Pickup state you can call an ACS script to announce and manage things, etc.

User avatar
Kaminsky
Developer
Posts: 193
Joined: Sun Apr 14, 2013 7:17 pm
Location: Canada

[ACS] Re: Dropping a flag via script?

#9

Post by Kaminsky » Sat Sep 09, 2017 3:57 pm

You can also use the Inventory.PickupAnnouncerEntry property to play an announcer sound entry when the item is being picked up by the player. For example, if you define custom flag items for the blue and red teams, you would use the entries "blueflagtaken" and "redflagtaken" respectively.

Code: Select all

Actor CustomBlueFlag : Inventory // Flag item for the blue team.
{
	Inventory.PickupAnnouncerEntry "blueflagtaken"
}

Actor CustomRedFlag : Inventory // Flag item for the red team.
{
	Inventory.PickupAnnouncerEntry "redflagtaken"
}

Post Reply