Jump to content

Photo

Need help with enemy scripts and scripting in general


  • Please log in to reply
35 replies to this topic

#16 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 07 March 2023 - 02:51 PM

does your script include it?

...given that my script does not use ghost.zh AT ALL and has literally nothing to do with ghost.zh, no. My script is an NPC script, which is a 2.55 feature. Ghost.zh cannot handle npc scripts, and is a decade old, using none of the new features and being full of old jank.



#17 Bokoblin

Bokoblin

    added tree hair

  • Members

Posted 07 March 2023 - 03:01 PM

enemy scripts are what ghost.zh is made for though



#18 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 07 March 2023 - 03:01 PM

enemy scripts are what ghost.zh is made for though

Scripted enemies, using FFC scripts. Not NPC scripts, the 2.55 feature that DID NOT EXIST when ghost.zh was written. Ghost.zh is outdated and old, and lacks all new zc features.



#19 Bokoblin

Bokoblin

    added tree hair

  • Members

Posted 07 March 2023 - 03:03 PM

ok so what do i use for the newer scripts

 

i want to make eweapon scripts and scripts for bosses



#20 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 07 March 2023 - 03:06 PM

ok so what do i use for the newer scripts

 

i want to make eweapon scripts and scripts for bosses

There are no headers for new scripts, it's all just part of zscript. To make an eweapon script, you.... declare an eweapon script. And then make it do what you want it to do. To make an npc script, you... declare an npc script and make it do what you want it to do. Look for instance at my summoner script (which is designed to be placed on an enemy using engine movement).



#21 Bokoblin

Bokoblin

    added tree hair

  • Members

Posted 07 March 2023 - 03:07 PM

doesn't ghost.zh add new functions though?

 

doesn't that make it easier?



#22 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 07 March 2023 - 03:19 PM

doesn't ghost.zh add new functions though?

 

doesn't that make it easier?

Several things ghost.zh does, such as movement functions that handle collision for you, are now available in engine. Not EVERY thing that ghost.zh adds is available in engine, but ghost.zh is completely incompatible with npc scripts - again, it was designed a decade ago when there were less features. Also, to set up an NPC script, all you have to do is set the script in the enemy editor, the same way you set up almost any other scripts. Ghost scripts require one of:

  • Manually placing FFCs to spawn the enemies
  • Setting a specific value in the name of the enemy so that the global script can attach an FFC for you
  • Setting a value in one of the misc attributes, which you have to type in manually, so that the global script can attach an FFC for you

Additionally, ghost also requires setting up script constants to the correct values, such as the invisible combo that compile error is pointing at. And, due to using FFCs, there is a much smaller limit on how many ghosted enemies can exist on the screen at a time- used to be 32, though now FFCs go up to 128, so it's not *as* much of an issue.

 

Compared to npc scripts, which you just assign in the script tab of the enemy editor via dropdown, and they just work.



#23 Bokoblin

Bokoblin

    added tree hair

  • Members

Posted 07 March 2023 - 03:31 PM

ok then im deleting it, moosh said i could still use it, and he's...moosh. ofc i believed him



#24 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 07 March 2023 - 03:33 PM

ok then im deleting it, moosh said i could still use it, and he's...moosh. ofc i believed him

...I mean, he isn't wrong, you still can, and frankly most old scripters do- though I'd say mostly because it's what they are used to using. IMO it's more difficult to use by far than NPC scripts, but, others disagree with me on that.

My scripts certainly won't ever have anything to do with ghost though, and I'll never be able to help with ghost scripts because I'm not taking the time and effort to learn that jank mess.



#25 Bokoblin

Bokoblin

    added tree hair

  • Members

Posted 07 March 2023 - 03:57 PM

ok i deleted it and its still giving me a ghost error when i compile


OXLUGsX.png


Gs3lFy8.png



#26 Deedee

Deedee

    Bug Frog Dragon Girl

  • Moderators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 07 March 2023 - 05:42 PM

Could you copy your entire buffer and paste it in a code block? It looks like the errors are coming from further down in the buffer.

Also, Moosh isn't wrong here; Ghost would probably be more helpful for learning how to script an enemy given that it has more scripts to use as learning experiences. NPCScript means you need to handle all the animation yourself, which might be more complicated for you.



#27 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 07 March 2023 - 07:06 PM

There are no headers for new scripts

 

NPCScript means you need to handle all the animation yourself, which might be more complicated for you.

Everybody's really here acting like my animation header doesn't exist.  :blah:  I do agree that ghost is more user friendly, though I've tried my best to do my part in addressing that.
 
 

ok i deleted it and its still giving me a ghost error when i compile

 
Anyways, those errors imply that if you scroll down in the ZQ script buffer to line 119, you should see those ghost imports again. You probably don't want to be importing things lower down in the buffer below your scripts, as that will just confuse your organization, like it has done here.

Also while it's probably not the best time as Bokoblin can't even import ghost on its own right now, I did try my hand at that ghost.zh example script



#28 Bokoblin

Bokoblin

    added tree hair

  • Members

Posted 07 March 2023 - 08:31 PM

thank you, creepy man with legs for hands



#29 Bokoblin

Bokoblin

    added tree hair

  • Members

Posted 07 March 2023 - 08:48 PM

MKtAGG6.png


KEYigjt.png


yo what should i set the debug value to



#30 Bokoblin

Bokoblin

    added tree hair

  • Members

Posted 07 March 2023 - 10:09 PM

i also need to set up my first script

 

 

since guys arent working for me, i need to code 2 scripts. one that displays a string when you enter a room, another that consists of a static NPC (no movement, no ai, just a sprite) that dies when the string stops playing.

 

i need to do this 4 times (4 different screens where you encounter this character)

 

how would i go about doing that?


i also need to make the npc use a certain sprite and go on a certain tile.


are coords supposed to be (pos, combo) instead of (x,y)? it doesnt say the actual coords, it just says pos, combo.


oh also the strings only play once




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users