Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
baja blast rd.

*** The "ask a miscellaneous editing question" thread ***

Recommended Posts

My final request, which shows that I have no idea about the language the Doom engine uses to do things.

Supposing I want a CACODEMON to actually be a PAIN ELEMENTAL 25% of the time that they spawn in the game, where do I write these script? Does it go in their .txt or does it need to be separate from that??

Share this post


Link to post

That script is made to be used in a specific place in a specific map. It will not help you if you want it to automatically apply onto all maps played with your mod. You need to make a DECORATE-based randomizer:

1. Find definition of the mod specific Cacodemon actor, and remove the words "replaces Cacodemon" from its header.
2. Create a dummy actor replacing the Cacodemon (for example "actor MyCacoPainSpawner replaces Cacodemon").
3. Make it perform a random jump in its states, with probability 64/256, branching it into two separate animations.
4. In one branch, make it spawn a Cacodemon and remove itself. (Note: It must be the mod specific name of Cacodemon, not just "Cacodemon".)
5. In the other branch, make it spawn a Pain Elemental and remove itself.

Something like this: (I haven't tested this particular code, but if it doesn't work as is, a very similar code should work)

actor MyCacoPainSpawner replaces Cacodemon {
  States {
Spawn:
  TNT1 A 0
  TNT1 A 0 A_Jump(64,"Spawn2")
  TNT1 A 0 A_SpawnItemEx("InsertTheModdedCacodemonClassnameHere",0,0,0,0,0,0,0,SXF_TRANSFERAMBUSHFLAG|SXF_TRANSFERSPECIAL)
  stop
Spawn2:
  TNT1 A 0 A_SpawnItemEx("InsertTheModdedPainElementalClassnameHere",0,0,0,0,0,0,0,SXF_TRANSFERAMBUSHFLAG|SXF_TRANSFERSPECIAL)
  stop
  }
}
EDIT: Or possibly easier and cleaner, use a custom actor derived from RandomSpawner to do via DropItem what the spawner above does via States.

Share this post


Link to post
Poormetheus said:

Supposing I want a CACODEMON to actually be a PAIN ELEMENTAL 25% of the time that they spawn in the game, where do I write these script? Does it go in their .txt or does it need to be separate from that??


Just copy this into Decorate:

actor CacodemonReplacer: RandomSpawner replaces Cacodemon
{
	DropItem "Cacodemon"
	DropItem "Cacodemon"
	DropItem "Cacodemon"
	DropItem "PainElemental"
}
It's a very easy random spawner. There're 3 caco entries here and only 1 pain elemental entry, so pain elemental will only spawn 1/4 of the time (and that's 25%).

Share this post


Link to post

^ In your code as it stands, "DropItem Cacodemon" would spawn another instance of the CacodemonReplacer itself, because it "replaces Cacodemon". So, the "Cacodemon" after "DropItem" must be replaced by a different class that actually is the Cacodemon. And said actual Cacodemon actor needs to be altered to not have "replaces Cacodemon" in its definition anymore. Then it will work.

Share this post


Link to post
scifista42 said:

So, the "Cacodemon" after "DropItem" must be replaced by a different class that actually is the Cacodemon. And said actual Cacodemon actor needs to be altered to not have "replaces Cacodemon" in its definition anymore. Then it will work.


Oh, sorry, I forgot about that.

Share this post


Link to post
scifista42 said:

Something like this: (I haven't tested this particular code, but if it doesn't work as is, a very similar code should work)


You, sir, are a genius. It works perfectly!

Thank you!

^^

Share this post


Link to post
ChekaAgent said:

Just copy this into Decorate:


actor PlainOldCaco : Cacodemon {}
actor CacodemonReplacer: RandomSpawner replaces Cacodemon
{
	DropItem "PlainOldCaco" 255 3
	DropItem "PainElemental"
}
There, so that there's one valid example or RandomSpawner use in the thread.

Share this post


Link to post

So, quick question.
When I open a door in my map, it will sometimes create this invisible wall or whatever that prevents me from going through. It also glitches a sector for some reason.

Share this post


Link to post
rdwpa said:

Is it possible in GZDB to bind an action such that it's triggered in two separate ways?

No.

Share this post


Link to post
Frisky said:

So, quick question.
When I open a door in my map, it will sometimes create this invisible wall or whatever that prevents me from going through. It also glitches a sector for some reason.

Make sure that your door (the sector that gets affected by the door linedef action) consists of only 1 sector rather than multiple ones.

Share this post


Link to post

I'm trying to make a door that needs a keycard and after the door is opened by the player the required keycard gets removed but for some reason keycard does not get removed.

script "DoorLock"  (void) 
{
	Generic_Door (0,32,1,0,0);
	TakeInventory (T_YELLOWKEYCARD,1);
}

Share this post


Link to post

Or

    TakeInventory ("YellowCard", 1);
It's because TakeInventory accepts the thing's class name, not its spawn id.

Share this post


Link to post
Kappes Buur said:

Try

    TakeInventory ("T_YELLOWKEYCARD", 1);

No.

T_YELLOWKEYCARD is a constant identifier, not a string. (The compiler replaces it by 87.) Scifista's answer is correct.

Share this post


Link to post

"yellowcard" works.
ty

EDIT:
Is there a way to make so that the player can't pick up more than one keycard or make keycards stack?

Share this post


Link to post
illuknisaa said:

Is there a way to make so that the player can't pick up more than one keycard or make keycards stack?

Sure. Read up on inventory property and then make your custom key an item with an Inventory.MaxAmount of 1 or whatever number you want.

Yeah, you will have to replace the standard keys with custom types to do that. And your custom keys cannot be derived from the normal "key" base class, as well.

Share this post


Link to post

I added some custom sprites to my wad and now gzdoom builder complains "error in actor "coffeemug". unsupported sprite name format "cmuga"

decoratate *******ion:

Actor CoffeeMug 257
{
//$Category Decoration
  +FloorClip
  Height 7
  Radius 2
  States
  {
  Spawn:
    CMUG A -1
    Stop
  }
}

I've used this same actor in an another wad and it worked fine there. Sprite name is CMUGA0.
edit: d-e-f-i-n-a-t-i-o-n is censored?

Share this post


Link to post
illuknisaa said:

error in actor "coffeemug". unsupported sprite name format "cmuga"

This means the editor is unable to find a valid sprite, which name starts with "cmuga", in the sprites namespace.

Share this post


Link to post
illuknisaa said:

decoratate *******ion:

<snip>

edit: d-e-f-i-n-a-t-i-o-n is censored?


The correct spelling is "definition".

Also, DECORATE.

Share this post


Link to post

@DooM_RO You need to define it in the MAPINFO lump.
http://zdoom.org/wiki/Intermission_script

I have a custom actor and trying to call it from a script (eg. ThingSpawn) but when I do nothing happens.

decorate:

Actor OneUseYellowCard : Inventory 258
{
//$Category Keys

  Inventory.PickupMessage "You picked up a yellow keycard."
  Inventory.Icon "STKEYS1"
  Inventory.MaxAmount 100
  SpawnID 258
  States
  {
  Spawn:
    YKEY A 10
    YKEY B 10 Bright
    Loop
  }
}

Share this post


Link to post
illuknisaa said:

@DooM_RO You need to define it in the MAPINFO lump.
http://zdoom.org/wiki/Intermission_script

I have a custom actor and trying to call it from a script (eg. ThingSpawn) but when I do nothing happens.

decorate

Actor OneUseYellowCard : Inventory 258
{
//$Category Keys

  Inventory.PickupMessage "You picked up a yellow keycard."
  Inventory.Icon "STKEYS1"
  Inventory.MaxAmount 100
  SpawnID 258
  States
  {
  Spawn:
    YKEY A 10
    YKEY B 10 Bright
    Loop
  }
}


Yes, but I also want it to work on PrBoom+.

I've downloaded WhackED4. I changed the level name and intermission text (but not music yet) but I get this error:

Traceback (most recent call last):
File "src\whacked4\ui\mainwindow.py", line 685, in file_save
File "src\whacked4\ui\mainwindow.py", line 330, in save_file
File "src\whacked4\dehacked\patch.py", line 220, in write_dehacked
File "src\whacked4\dehacked\patch.py", line 262, in write_patch_ext_strings
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 351: ordinal not in range(128)

The level names are changed but not the intermission text. I wrote it in Word and copy pasted it...I don't know why but something tells me this is the problem.

Share this post


Link to post

If you have a Doom remix song you're using in your wad that you would like to submit to the Doom Archives however the artist is unknown despite searching for him or her, how can one go about it? Is it possible to submit while claiming of unknown (but mention you're prepared to adjust asap) Or is the Wad on archive deadlock until all songs are credited?

Share this post


Link to post

Right. My intermission text is fine in Zdoom but it doesn't have enough space in PrBoom+. Is there any way to fix this or change the font of the intermission text?

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
×