Hello ! Having done three thousand times different threads, in each different section, Trooper Dan kindly advised me to stop and simply make a real thread, all my improvements and my coding problems.
What strikes me is that simple solutions never hit my mind the first time.
So, I'll post here, most of the problems that I can not fix (for the moment).
We will resume from the beginning. I will relaunch the subject of BOSS, before the other subject: "bloodpool sprite resize"
The subject concerned the value "ifspritepal 3" that I chose for a specific action: to make in first action, a BOSS which advances towards the player, before it attacks.
I tested and placed the code in the file, and it did not work. My question was this:
state checkboss2seekstate
ai AIBOSS2SEEKENEMY
ifspritepal 0 nullop
else // a fake way of doing a ifspritepal NOT.
ifspritepal 3 nullop
else
ifspritepal 22 nullop
else
move PALBOSS2RUNVELS seekplayer
ends
Do I have to put the same code each time there is "pal 0" and "pal 22" ?
onevent EVENT_SPAWN // big bloodpool for BOSS1
switch sprite[THISACTOR].picnum
case BLOODPOOL
ifspawnedby BOSS1
sizeat 60 60
break
endswitch
endevent
----02 Shrunk monsters: respawn action
New post for a particular topic about sprites.
When a monster is shrunk, I can now kill it another way. This has been improved for a while, by correcting codes.
However, I noticed two things that are not consistent.
1. A Liztroop that has been shrunk, will generate large ammunition and BLOODPOOL.
I would like to reduce the BLOODPOOL and removed the appearance of ammunition, only when they are shrunk. If the ammunition appeared are also small sizes, it will not be logical either.
----03 sound SQUISHED problem
I have a really tough problem here. I have defined a new "SQUISHED" sound for the monsters of the PSX version. However, this sound and that of the recognition, refuse to be played at the same time and even if it is the same sound that is played. These sounds simply refuse to be played multiple times at the same time.
For this first example in video, there is only one sound "SQUISHED" played
and image, or it is impossible to launch the sound several times, otherwise it bug.
I do not know what's causing this kind of shit.
A second video more explicit. Green color (LIZTROOP classics). Blue (LIZTROOP PSX version), for a comparison of sounds played.
On the side of classic green LIZTROOP, everything is fine (obviously, since it is the game at the base). As for the added blue LIZTROOP PSX, it's buggy.
1. "Sound of recognition" wanting to play several times, it's buggy.
2. "Sound SQUISHED2" wanting to play several times, sometimes it does not play at all.
There must be a solution on the side of the "gamevar" attributes for a sound to be played correctly without any problem.
This post has been edited by Firefly_Trooper: 14 November 2018 - 09:45 AM
01. BOSS and "ifspritepal 3" for the first move action.
02. BLOODPOOL resize for the all BOSS and shrinker.
03. Deleted AMMO for the monsters shrunked.
04. SQUISHED sound problem for all monsters for the PSX version.
This post has been edited by Firefly_Trooper: 14 November 2018 - 09:49 AM
Firefly_Trooper, on 14 November 2018 - 04:32 AM, said:
I tested and placed the code in the file, and it did not work. My question was this:
state checkboss2seekstate
ai AIBOSS2SEEKENEMY
ifspritepal 0 nullop
else // a fake way of doing a ifspritepal NOT.
ifspritepal 3 nullop
else
ifspritepal 22 nullop
else
move PALBOSS2RUNVELS seekplayer
ends
Do I have to put the same code each time there is "pal 0" and "pal 22" ?
Okay, I'm going to explain some basic coding philosophy that really helped me when it was explained to me this way. I was once intimidated by coding because I believed it to be largely mathematical, and I'm terrible with math. While mathematics are a large component of programming what it really is is language and it's crucial you think of it this way because that's how it actually functions. When you're programming what you're really doing is speaking to a computer in it's own language. So if your language is poor your outcome is equally as poor, because the computer isn't like a person. It won't "basically understand" what you're "trying to say" and adjust it's response because you're not "speaking" it's language well. You have to be very precise because it's going to either spit out exactly what you tell it to, or if your "language" is really bad then crazy, strange or catastrophic events will occur. If the computer interprets nothing but gibberish, you'll probably get a crash. An equal output for the input.
Okay so what I'm going to do is "translate" portions of your code into English and I want you to tell me why setting pal to 3 doesn't do anything.
state checkboss2seekstate
ai AIBOSS2SEEKENEMY
if the sprite's palette is set to 0 DO NOTHING
else
if the sprite's palette is set to 3 DO NOTHING
else
if the sprite's palette is set to 22 DO NOTHING
else (if the sprite's palette is set to LITERALLY ANY OTHER NUMBER)
move PALBOSS2RUNVELS seekplayer
ends
This post has been edited by Jimmy 4k: 14 November 2018 - 10:07 AM
Frankly I do not know. All I wish is to be able to advance to the player a mini-boss. The "pal 0" with a lotag of "3" in one sector, the action works. To do the same thing with a mini-boss? I do not know.
I'm not going to write your code for you or give you the answer because you'll never learn otherwise. Study my post and the code and try to understand what the code actually says. The problem is very simple. If you want a miniboss with sprite pal 3 to do something, then you need to actually tell it to do something. Right now your code is actually working 100% as written, but because you don't understand the code you've written it's not doing what you're intending.
I can not keep both "spritepal" actions 3 and 22 at the same time. I do not know how to correctly build the line of code because I tried a lot of method but nothing worked.
This post has been edited by Firefly_Trooper: 16 November 2018 - 12:30 PM
You're guessing how to write code, and that's the problem. You don't understand the commands and how they should be used. What you want to do is incredibly simple, but you need to learn what the commands mean first.
Of course with critical remarks, I will surely move forward and understand very quickly. I see only one thing on this forum. Sometimes you are not always sensitive when you answer. I feel like an idiot, rather than an apprentice coder who wants to make an effort. I am not targeting anyone here. I just feel like you're a bit "tough" and maybe not humble enough?
To return to this code "incredibly simple" but it is not at all for me. Even looking at the wiki more often, I am sometimes overwhelmed.
Tough but fair. I would say, if you aren't making the effort to learn what the commands mean and how to use them (through the wiki and hundreds of examples which can be found in any CON code) then you aren't really respecting the time of those who are trying to help you.
So far, I have already made a lot of progress in my project and I have also managed to create my codes. I have already done a lot of effort. It's just that at times, some codes are "ABSOLUTELY NOT" obvious.
Despite my failures, I want to continue coding. I will return to this passage of BOSS2.
My last attempt, of course, does not work. I swear to you that I do not deliberately do not understand. I have absolutely no clue or concrete example for the two "spritepal" values to work.
Think of it as a simple chain of logic, line by line. What you wrote is:
"If the sprite's palette is 0, use the normal ai routine, otherwise let's move on. Now we've checked the sprite's palette to see if it was number 3, and it was not so we will apply this new strength value. Now let's start this new ai routine we have here and change the clipping distance of this sprite. Okay, so now we will check this sprite's palette again to see if it was 22, and it was so we'll do nothing. Now let's apply the same ai routine we already applied, and we'll also set the sprite's clipping distance to 16 again."
To group statements together so they apply to the same if or else you use { }
You can use "else if" statements to make sure to check another case before moving on completely with "else".
I'm being tough because this is foundational. If you don't understand what the problem is here you will run into this very same problem over and over again. This is a critical learning point for you.
I agree, of course ! The only thing I ask is to be more forgiving and less brutal. In short, let's move on to something else.
Surely the "ai" with the "spritepal" must be in "ifai"
This post has been edited by Firefly_Trooper: 17 November 2018 - 11:12 AM
The famous code of "spritepal" that has not been solved, even reading the wiki, I always feel overwhelmed.
While waiting to finally have an answer to this problem, I took care of another code still related to the BOSS.
I made a code with "onevent" to enlarge the BLOODPOOL in a progressive way.
onevent EVENT_SPAWN // big bloodpool for BOSS2
switch sprite[THISACTOR].picnum
case BLOODPOOL
ifspawnedby BOSS2
sizeat 60 60
break
endswitch
endevent
It works well, except that the sprite "BLOODPOOL" appears brutally, without progressive animation frame. I wanted to replace "sizeat" with "sizeto" and it did not work. I also tried this:
onevent EVENT_SPAWN // big bloodpool for BOSS2
switch sprite[THISACTOR].picnum
case BLOODPOOL
ifspawnedby BOSS2
setactor[THISACTOR].xrepeat 60
setactor[THISACTOR].yrepeat 60
break
endswitch
endevent
Result, nothing!
How can we show some sprites in a progressive way? Thanks you for your answers.
The sizeto command changes size incrementally each time it is executed. EVENT_SPAWN only executes once, when a sprite spawns, so using sizeto there is useless.
Last question about BLOODPOOL sprite. When I use this same code for shrunken monsters, the sprite BLOODPOOL bug a bit when Duke walks on it. It is as if the puddle continues to be diminished when it is already small. Is there a value that blocks the size action of a sprite ?