Convert a gzdoom specific monsters to run on zandronum

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

Convert a gzdoom specific monsters to run on zandronum

#1

Post by ibm5155 » Mon Jan 21, 2013 11:58 am

Hi, so I created a monster, but it only works on gzdoom =/ and I would like to put it to work on zandronum, so here´s the original code

[spoiler]

Code: Select all

actor ravishing 31198
{
  MONSTER
  Radius 16//31
  Height 66
  Health 500
  Mass 100
  scale 0.065
  Speed 12
  PainChance 100
  +DONTHURTSPECIES +NOTARGET +FULLVOLDEATH 
  SeeSound "EFF6"
  PainSound "EFF9"
  DeathSound "EFF7"
  ActiveSound ""
  AttackSound ""
  MeleeSound ""
  MeleeDamage  1
  Obituary "You was killed by the ravishing"
  var int user_ghoulactivesound;
  var int user_ghoulactivesound2;
  var int user_ghoulinvisible;//var that told if it is invisible or not
  var int user_ghoulinvisiblecount;//count the time that´s invisible
  var int user_ghoulfirsttime;
  
  States
  {
  Spawn:
    ghou A 0 A_SetUserVar ("user_ghoulfirsttime",1)
    ghou A 0 A_SetUserVar ("user_ghoulactivesound",0)
    ghou A 0 A_SetUserVar ("user_ghoulactivesound2",0)
    ghou A 0 A_SetUserVar ("user_ghoulinvisible",1)
    ghou A 1 A_Look
    Loop

   See:
    ghou A 0 A_JumpIf(user_ghoulfirsttime==1,"GHOULALPHAIN")
    ghou A 0 A_SetUserVar("user_ghoulinvisiblecount",user_ghoulinvisiblecount+1)//0 1 2 3 4 5 6 7 - 8 9 0 1
    ghou A 0 A_JumpIf(user_ghoulactivesound>=7,"GHOULSND")//0 1 2 3 4 5 6 7 0 1 2 - -
    ghou A 0 A_JumpIf(user_ghoulactivesound2>=7,"GHOULSND2")
    ghou A 0 A_JumpIf(user_ghoulinvisible==1,"GHOULNSEE")// 1 1 1 1 1 1 1 - 1 1 1 0 0
    ghou A 0 A_JumpIf(user_ghoulinvisible==0,"GHOULSEE")//  - - - - - - - - - - - 1 1
    Loop

 GHOULNSEE://invisible ghoul see
    ghou A 0 A_ChangeFlag("INVULNERABLE",1)
    ghou A 0 A_SetUserVar("user_ghoulinvisiblecount",user_ghoulinvisiblecount+1)//1 2 3 4 5 6 7 0 1 2 3
    ghou A 0 A_ChangeFlag("NOCLIP",1)
    ghou A 0 A_SetUserVar ("user_ghoulactivesound",user_ghoulactivesound+1)//contador som 1 2 3 4 5 6 7 8 9 10
    ghou G 0 A_JumpIf(user_ghoulinvisiblecount>=60,"GHOULALPHAOUT")//0 0 0 0 0 0 0 0 0 1
    ghou ABCDEFG 2 A_Chase
    Goto see

 GHOULSEE://visible ghoul
    ghou A 0 A_ChangeFlag("INVULNERABLE",0)
    ghou A 0 A_ChangeFlag("NOCLIP",0)
    ghou A 0 A_SetUserVar ("user_ghoulactivesound2",user_ghoulactivesound2+1)
    ghou G 0 A_JumpIf(user_ghoulinvisiblecount>=30,"GHOULALPHAIN")
    ghou ABCDEFG 2 A_Chase
    Goto see

 GHOULSND://play the sound that he does when invisible
	ghou A 0 A_SetUserVar ("user_ghoulactivesound",0)
	ghou A 0 A_Playsound("EFF5")
	Goto see

 GHOULSND2://play the sound that he does when visible
	ghou A 0 A_SetUserVar ("user_ghoulactivesound2",0)
	ghou A 0 A_Playsound("EFF10")
	Goto see

 GHOULALPHAIN://ghoul being visible
	ghou A 0 A_SetUserVar("user_ghoulfirsttime",0)
        ghou A 1 A_SetTranslucent (1.0,0)
	ghou A 1 A_SetTranslucent (0.9,0)
	ghou A 1 A_SetTranslucent (0.8,0)
	ghou A 1 A_SetTranslucent (0.7,0)
	ghou A 1 A_SetTranslucent (0.6,0)
	ghou A 1 A_SetTranslucent (0.5,0)
	ghou A 1 A_SetTranslucent (0.4,0)
	ghou A 1 A_SetTranslucent (0.3,0)
	ghou A 1 A_SetTranslucent (0.2,0)
	ghou A 1 A_SetTranslucent (0.1,0)
	ghou A 1 A_SetTranslucent (0.0,0)
	ghou A 0 A_SetUserVar("user_ghoulinvisiblecount",0)
	ghou A 0 A_SetUserVar("user_ghoulinvisible",1)
	Goto see

 GHOULALPHAOUT://ghoul going out visibility 
	ghou A 0 A_SetUserVar("user_ghoulfirsttime",0)
        ghou A 1 A_SetTranslucent (0.0,0)
	ghou A 1 A_SetTranslucent (0.1,0)
	ghou A 1 A_SetTranslucent (0.2,0)
	ghou A 1 A_SetTranslucent (0.3,0)
	ghou A 1 A_SetTranslucent (0.4,0)
	ghou A 1 A_SetTranslucent (0.5,0)
	ghou A 1 A_SetTranslucent (0.6,0)
	ghou A 1 A_SetTranslucent (0.7,0)
	ghou A 1 A_SetTranslucent (0.8,0)
	ghou A 1 A_SetTranslucent (0.9,0)
	ghou A 1 A_SetTranslucent (1.0,0)
	ghou A 0 A_SetUserVar("user_ghoulinvisiblecount",0)
	ghou A 0 A_SetUserVar("user_ghoulinvisible",0)
	Goto see
    
  Pain:
        ghou a 0 A_Pain
	Goto See
  Melee:
        ghou G 0 A_JumpIf(user_ghoulinvisible==1,"GHOULNSEE")
	ghou G 0 A_Playsound("EFF8")
        ghou G 1 A_FaceTarget
	ghou G 0 A_MeleeAttack
        ghou HIJKJIH 1 
	Goto See


  Death:
    ghou A 8 
    ghou B 8 A_Scream
    ghou C 8
    ghou D 8 A_SetTranslucent(1.0,0)
    ghou E 8 A_Fall
    ghou D 8
    ghou E 8
    tnt1 A -1 A_SetFloorClip
    Stop

  Raise:
    pair L 8 A_UnSetFloorClip
    pair KJIHG 8
    Goto See

  }
}
[/spoiler]

I tried to convert it to run on zandronum and the result was that:
DECORATE PART
[spoiler]

Code: Select all

actor ravishing 31198
{
  MONSTER
  Radius 16//31
  Height 66
  Health 0x7fffffff
  Mass 100
  scale 0.065
  Speed 18
  PainChance 100
  +DONTHURTSPECIES +NOTARGET +FULLVOLDEATH 
  SeeSound "EFF6"
  PainSound "EFF9"
  DeathSound "EFF7"
  ActiveSound ""
  AttackSound ""
  MeleeSound ""
  MeleeDamage  1
  Obituary "You was killed by the ravishing"
  
  States
  {
  Spawn:
    ghou A 1 A_Look
    Loop
  See:
        ghou A 0 A_JumpIf(ACS_ExecuteWithResult(476,1)==1,"Shotgun")
	ghou A 0 A_JumpIf(ACS_ExecuteWithResult(8,4,0)==1,"GHOULALPHAIN")
	ghou A 0 ACS_Execute(8,3,1)
	ghou A 0 A_JumpIf(ACS_ExecuteWithResult(8,0,0)>=7,"GHOULSND")
	ghou A 0 A_JumpIf(ACS_ExecuteWithResult(8,1,0)>=7,"GHOULSND2")
	ghou A 0 A_JumpIf(ACS_ExecuteWithResult(8,2,0)==1,"GHOULNSEE")
	ghou A 0 A_JumpIf(ACS_ExecuteWithResult(8,2,0)==0,"GHOULSEE")
    Loop

 GHOULNSEE:
        ghou A 0 A_ChangeFlag("INVULNERABLE",1)
	ghou A 0 ACS_Execute(8,3,1)
        ghou A 0 A_ChangeFlag("NOCLIP",1)
	ghou A 0 ACS_Execute(8,0,1)
	ghou G 0 A_JumpIf(ACS_ExecuteWithResult(8,3,0)>=60,"GHOULALPHAOUT")
        ghou ABCDEFG 2 A_Chase
	Goto see

 GHOULSEE:
    ghou A 0 A_ChangeFlag("INVULNERABLE",0)
    ghou A 0 A_ChangeFlag("NOCLIP",0)
    ghou A 0 ACS_Execute(8,1,1)
    ghou G 0 A_JumpIf(ACS_ExecuteWithResult(3,3,0)>=30,"GHOULALPHAIN")
    ghou ABCDEFG 2 A_Chase
    Goto see

 GHOULSND://toca som ativo invisivel
	ghou A 0 ACS_Execute(8,0,-1)
	ghou A 0 A_Playsound("EFF5")
	Goto see

 GHOULSND2:
	ghou A 0 ACS_Execute(8,1,-1)
	ghou A 0 A_Playsound("EFF10")
	Goto see

 GHOULALPHAIN:
	ghou A 0 ACS_Execute(8,4,-1)
        ghou A 1 A_SetTranslucent (1.0,0)
	ghou A 1 A_SetTranslucent (0.9,0)
	ghou A 1 A_SetTranslucent (0.8,0)
	ghou A 1 A_SetTranslucent (0.7,0)
	ghou A 1 A_SetTranslucent (0.6,0)
	ghou A 1 A_SetTranslucent (0.5,0)
	ghou A 1 A_SetTranslucent (0.4,0)
	ghou A 1 A_SetTranslucent (0.3,0)
	ghou A 1 A_SetTranslucent (0.2,0)
	ghou A 1 A_SetTranslucent (0.1,0)
	ghou A 1 A_SetTranslucent (0.0,0)
	ghou A 0 ACS_Execute(8,3,-1)
	ghou A 0 ACS_Execute(8,2,1)
	Goto see

 GHOULALPHAOUT:
	ghou A 0 ACS_Execute(8,4,-1)
        ghou A 1 A_SetTranslucent (0.0,0)
	ghou A 1 A_SetTranslucent (0.1,0)
	ghou A 1 A_SetTranslucent (0.2,0)
	ghou A 1 A_SetTranslucent (0.3,0)
	ghou A 1 A_SetTranslucent (0.4,0)
	ghou A 1 A_SetTranslucent (0.5,0)
	ghou A 1 A_SetTranslucent (0.6,0)
	ghou A 1 A_SetTranslucent (0.7,0)
	ghou A 1 A_SetTranslucent (0.8,0)
	ghou A 1 A_SetTranslucent (0.9,0)
	ghou A 1 A_SetTranslucent (1.0,0)
	ghou A 0 ACS_Execute(8,3,-1)
	ghou A 0 ACS_Execute(8,2,-1)
	Goto see
    
  Pain:
        ghou a 0 A_Pain
	Goto See

  Melee:
	ghou G 0 A_jumpif(ACS_ExecuteWithResult(8,2,0)==1,"GHOULNSEE")
	ghou G 0 A_Playsound("EFF8")
        ghou G 1 A_FaceTarget
	ghou G 0 A_MeleeAttack
        ghou HIJKJIH 1 
	Goto See


  Death:
    ghou A 8 
    ghou B 8 A_Scream
    ghou C 8
    ghou D 8 A_SetTranslucent(1.0,0)
    ghou E 8 A_Fall
    ghou D 8
    ghou E 8
    tnt1 A -1 A_SetFloorClip
    Stop

  Raise:
    pair L 8 A_UnSetFloorClip
    pair KJIHG 8
    Goto See

  }
}
[/spoiler]
ACS part
[spoiler]

Code: Select all

int user_ghoulactivesound=0;
int user_ghoulactivesound2=0;
int user_ghoulinvisible=1;//variavel fala se esta invisivel ou nao
int user_ghoulinvisiblecount=0;//conta tempo que esta invisivel
int user_ghoulfirsttime=1;
script 8 (int x, int y) 
{
	switch(x)
	{
		case 0:
			if(y==1)
			{
				user_ghoulactivesound++;
			}
			else if(y==-1)
			{
				user_ghoulactivesound=0;
			}
			else
			{
				setresultvalue(user_ghoulactivesound);
			}
			//user_ghoulactivesound
			break;
			
		case 1:
		    if(y==1)
			 {
				user_ghoulactivesound2++;
			 }
			 else if(y==-1)
			 {
				user_ghoulactivesound2=0;
			 }
			 else
				setresultvalue(user_ghoulactivesound2);
			//user_ghoulactivesound2
			
		case 2:
			 if(y==1)
			 {
				user_ghoulinvisible=1;
			 }
			 if(y==0)
			 {
				setresultvalue(user_ghoulinvisible);
			 }
			 //user_ghoulinvisible
			 break;
			 
		case 3:
			 if(y==1)
			 {
				user_ghoulinvisiblecount++;
			 }
			 else if(y==-1)
			 {
				user_ghoulinvisiblecount=0;
			 }
			 else
			 {
        setresultvalue(user_ghoulinvisiblecount);
			 }
			 //user_ghoulinvisiblecount
			 break;
			 
		case 4:
			 if(y==-1)
			 {
				user_ghoulfirsttime=0;
			 }
			 else
				setresultvalue(0);
			 //user_ghoulfirsttime
			 break;
	}
}
[/spoiler]
The good part, it worked on zandronum, the bad part, sound are not being played, the monster can´t be visible, and it crash if you try to use it online =/.
So any help would be very good pls, i am not a expert on decorate :s
Last edited by ibm5155 on Mon Jan 21, 2013 5:41 pm, edited 1 time in total.
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

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

RE: Convert a gzdoom specific monsters to run on zandronum

#2

Post by Ivan » Mon Jan 21, 2013 12:51 pm

There's no break; at the end of case1. The rest, I didn't feel like reading it due to the horrible indenting :P
=== 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
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: Convert a gzdoom specific monsters to run on zandronum

#3

Post by ibm5155 » Mon Jan 21, 2013 1:36 pm

ahh, i miss it, and sorry. zandronum forum just eat the spaces .-., but I have other problem i think, it looks like the monsters isnt even calling the script D:
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: Convert a gzdoom specific monsters to run on zandronum

#4

Post by ibm5155 » Mon Jan 21, 2013 5:38 pm

Double post
------------
Ahhhh, It´s much better for my eyes now, i just think i couldn´t put the code into the spoiler, so now you can see much better (and i translated somethings too...)
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

HexaDoken
Forum Regular
Posts: 352
Joined: Wed Jul 04, 2012 8:27 am
Location: Void. Russian Void.

RE: Convert a gzdoom specific monsters to run on zandronum

#5

Post by HexaDoken » Tue Jan 29, 2013 2:15 pm

You know you can replicate the user variables with inventory. Monsters can hold inventory items pretty damn fine - they can't use them, but they are still lying in their pockets(if they have any?), making it useful for A_JumpIfInventory.

Sounds not playing is probably because you messed up your code or because you forgot SNDINFO.

In the See state, replace Loop keyword with Goto See keywords. This should fix the online crash.

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: Convert a gzdoom specific monsters to run on zandronum

#6

Post by ibm5155 » Thu Jan 31, 2013 8:35 pm

Wow i didn´t know about using inventory itens D:
thanks hexadoken :)
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: Convert a gzdoom specific monsters to run on zandronum

#7

Post by ibm5155 » Mon Feb 11, 2013 11:43 pm

Okay that´s the latest fix that I did, I´ll do that monster 100% decorate ¬¬
Well I´m a decorate noob, so how do I use the inventory items to count? :s (to see ravishing was the third thing that I created using decorate lol)
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

Cruduxy
Zandrone
Posts: 1059
Joined: Fri Jun 08, 2012 4:24 pm

RE: Convert a gzdoom specific monsters to run on zandronum

#8

Post by Cruduxy » Tue Feb 12, 2013 12:19 am

A_Jumpifinventory("Itemtype",Integer-amount,"WHATEVERSTATEBETWEENQUOTES").. it'll perform the jump if this actor have equal or above the inventory amount you specified..
A_GiveInventory("Type","Amount") is the way you'll give the actor the inventory -or probably some other ways but this is easiest.

When you define the inventory actor you don't need much beside the amount and maxamount properties.

Edit : To make it more obvious according to the GZdoom code
A_SetUservar would become the giveinventory.. A_Jumpif will become the jumpifinventory and know its always >=
Replace the variables with inventory actors just make sure they have a useful max amount since giveinventory lets you specify how much you give to the actor each time.
Last edited by Cruduxy on Tue Feb 12, 2013 12:22 am, edited 1 time in total.
[][][][][][][][][][][][][][][]
Nothing to see here
[][][][][][][][][][][][][][][]

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: Convert a gzdoom specific monsters to run on zandronum

#9

Post by ibm5155 » Tue Feb 12, 2013 9:00 pm

Too bad it´ll not be a simple translate =/
I crashed zandronum and when I saw he was using 2GB of ram O_O (only with that monster)
Well, time to clean the code =/

EDIT:he´s running without crash \o/, but no inventory is being received =/

Code: Select all

actor user_ghoulinvisiblecount : CustomInventory 31203
{
	+COUNTITEM
}

actor user_ghoulinvisible : CustomInventory 31202
{
	+COUNTITEM
}

actor user_ghoulactivesound2 : CustomInventory 31201
{
	+COUNTITEM
}

actor user_ghoulactivesound : CustomInventory 31200
{
	+COUNTITEM
}
actor user_ghoulfirsttime : CustomInventory 31199
{
  +COUNTITEM
}
actor ravishing 31198
{
  MONSTER
  Radius 20//31
  Height 66
  Health 5000000
  Mass 10000
  Speed 16
  Vspeed 16
  scale 0.065
  PainChance 180
   +FLOORCLIP +DONTHURTSPECIES +NOTARGET +BOSS +INVULNERABLE
  SeeSound "EFF6"
  PainSound "EFF9"
  DeathSound "EFF7"
  ActiveSound ""
  AttackSound ""
  MeleeSound ""
  MeleeDamage  15
  Obituary "%o was killed by the ravishing"
  states
  {
  Spawn:
    
    TNT1 A  0 A_GiveInventory  ("user_ghoulfirsttime",1)
    TNT1 A  0 A_GiveInventory ("user_ghoulinvisible",1)
    ghou A 1 A_Look
    Goto see

   See:
    ghou A 3 A_Chase
    ghou A 0 A_JumpIfInventory("user_ghoulfirsttime",1,"GHOULALPHAIN")
	ghou B 3 A_Chase
    ghou A 3 A_GiveInventory("user_ghoulinvisiblecount",1)
	ghou C 3 A_Chase
    ghou A 0 A_JumpIfInventory("user_ghoulactivesound",7,"GHOULSND")
	ghou D 3 A_Chase
    ghou A 0 A_JumpIfInventory("user_ghoulactivesound2",7,"GHOULSND2")
	ghou D 3 A_Chase
    ghou A 0 A_JumpIfInventory("user_ghoulinvisible",1,"GHOULNSEE")
	ghou F 3 A_Chase
    TNT1 A 0 A_JumpIfInventory("user_ghoulinvisible",0,"GHOULSEE")
	ghou G 3 A_Chase
    Goto see

GHOULNSEE://invisible ghoul see
    ghou A 0 A_ChangeFlag("INVULNERABLE",1)
    ghou A 0 A_GiveInventory("user_ghoulinvisiblecount",1)
    ghou A 0 A_ChangeFlag("NOCLIP",1)
    ghou A 0 A_GiveInventory ("user_ghoulactivesound",1)
    ghou G 1 A_JumpIfInventory("user_ghoulinvisiblecount",60,"GHOULALPHAOUT")
    Goto see

GHOULSEE://visible ghoul
    ghou A 0 A_ChangeFlag("INVULNERABLE",0)
    ghou A 0 A_ChangeFlag("NOCLIP",0)
    ghou A 0 A_GiveInventory ("user_ghoulactivesound2",1)
    ghou G 1 A_JumpIfInventory("user_ghoulinvisiblecount",30,"GHOULALPHAIN")
    Goto see

GHOULSND://play the sound that he does when invisible
    ghou A 0 A_TakeInventory  ("user_ghoulactivesound",255)//Clest inventory
    ghou A 0 A_Playsound("EFF5")
    Goto see

GHOULSND2://play the sound that he does when visible
    ghou A 0 A_TakeInventory  ("user_ghoulactivesound2",255)//Clear inventory
    ghou A 0 A_Playsound("EFF10")
    Goto see

GHOULALPHAIN://ghoul being visible
    ghou A 0 A_TakeInventory ("user_ghoulfirsttime",255)//Clear inventory
    ghou A 1 A_SetTranslucent (1.0,0)
    ghou A 1 A_SetTranslucent (0.9,0)
    ghou A 1 A_SetTranslucent (0.8,0)
    ghou A 1 A_SetTranslucent (0.7,0)
    ghou A 1 A_SetTranslucent (0.6,0)
    ghou A 1 A_SetTranslucent (0.5,0)
    ghou A 1 A_SetTranslucent (0.4,0)
    ghou A 1 A_SetTranslucent (0.3,0)
    ghou A 1 A_SetTranslucent (0.2,0)
    ghou A 1 A_SetTranslucent (0.1,0)
    ghou A 1 A_SetTranslucent (0.03,0)
    ghou A 0 A_TakeInventory ("user_ghoulinvisiblecount",255)//Clear inventory
    ghou A 0 A_GiveInventory("user_ghoulinvisible",1)
    Goto see

GHOULALPHAOUT://ghoul going out visibility 
    ghou A 0 A_TakeInventory ("user_ghoulfirsttime",255)//Clear inventory
    ghou A 1 A_SetTranslucent (0.0,0)
    ghou A 1 A_SetTranslucent (0.1,0)
    ghou A 1 A_SetTranslucent (0.2,0)
    ghou A 1 A_SetTranslucent (0.3,0)
    ghou A 1 A_SetTranslucent (0.4,0)
    ghou A 1 A_SetTranslucent (0.5,0)
    ghou A 1 A_SetTranslucent (0.6,0)
    ghou A 1 A_SetTranslucent (0.7,0)
    ghou A 1 A_SetTranslucent (0.8,0)
    ghou A 1 A_SetTranslucent (0.9,0)
    ghou A 1 A_SetTranslucent (1.0,0)
    ghou A 0 A_TakeInventory ("user_ghoulinvisiblecount",255)//Clear inventory
    ghou A 0 A_TakeInventory ("user_ghoulinvisible",255)//Clear inventory
    Goto see
    
  Pain:
        ghou a 0 A_Pain
    Goto See
  Melee:
        ghou G 0 A_JumpIfInventory("user_ghoulinvisible",1,"GHOULNSEE")
    ghou G 0 A_Playsound("EFF8")
        ghou G 1 A_FaceTarget
    ghou G 0 A_MeleeAttack
        ghou HIJKJIH 1 
    Goto See


  Death:
    ghou A 8 
    ghou B 8 A_Scream
    ghou C 8
    ghou D 8 A_SetTranslucent(1.0,0)
    ghou E 8 A_Fall
    ghou D 8
    ghou E 8
    tnt1 A -1 A_SetFloorClip
    Stop

  Raise:
    pair L 8 A_UnSetFloorClip
    pair KJIHG 8
    Goto See

  }
}

I don´t know if I need to do something more on the costuminventory or on the monster itself to put it to work =/
Last edited by ibm5155 on Tue Feb 12, 2013 9:16 pm, edited 1 time in total.
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

User avatar
Popsoap
 
Posts: 86
Joined: Mon Jun 04, 2012 2:38 pm
Location: Inside a wall

RE: Convert a gzdoom specific monsters to run on zandronum

#10

Post by Popsoap » Tue Feb 12, 2013 9:45 pm

First off, the inventory items don't need the COUNTITEM flag. The flag just makes it part of the total map percentage.

As far as the inventory items, you need to specify a max amount that can be held.

Code: Select all

actor user_ghoulinvisiblecount : CustomInventory 31203
{
    Inventory.MaxAmount 60
}
Another problem I noticed is in the spawn state. The first frame in the spawn state doesn't run when the actor is spawned, it only runs if it returns to the state later.

Code: Select all

Spawn:
    TNT1 A  0 A_GiveInventory  ("user_ghoulfirsttime",1) // This won't run when the monster is spawned
    TNT1 A  0 A_GiveInventory ("user_ghoulinvisible",1)
    ghou A 1 A_Look
    Goto see
Here is the way to fix it:

Code: Select all

Spawn:
    TNT1 A  0 // This frame here allows the following one to run when the monster spawns
    TNT1 A  0 A_GiveInventory  ("user_ghoulfirsttime",1)
    TNT1 A  0 A_GiveInventory ("user_ghoulinvisible",1)
    ghou A 1 A_Look
    Goto see

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: Convert a gzdoom specific monsters to run on zandronum

#11

Post by ibm5155 » Tue Feb 12, 2013 10:35 pm

I tried this and the same problem.
I checked on a loop printing the result using CheckActorInventory and only zero =/
I tried to call an script from the see stat and it didn´t called O_o (ghou F 2 ACS_Execute(666,0) , should print "test" on screen) [and if i puke 666 it show test]

I´m not an decorate expert, but one thing I know, the script 666 must be called (just a random number), It looks like hes not doing nothing special ;-;

here´s the download link for test the mod:http://www.mediafire.com/?w1iq5u62vagwbma

you must run it with zh-beta26
links here:http://sickedwick.net/wads/zh-beta26.zip
Last edited by ibm5155 on Tue Feb 12, 2013 10:38 pm, edited 1 time in total.
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

Post Reply