Yeah, the code is wrong. You aren't using any inner bracess, so every single line of code after "state troop_body_jibs" in those outer braces is going to be executed every time the corpse is hit by anything.
This is what it should look like:
ifhitweapon
{
ifwasweapon RADIUSEXPLOSION
{
state troop_body_jibs
state standard_jibs
sound SQUISHED
killit
}
}
CON is not Python. There is no off-side rule. The compiler doesn't give one fuck what is indented and what is not. You MUST group commands using { }. I have noticed this problem several times in what you have posted.
This post has been edited by Trooper Dan: 09 December 2018 - 07:10 PM
Reason for edit: typos
Thank you for this precious help. It's true that I do not use enough "{}"
Currently, I correct the whole file GAME.CON, because in the end, a lot of problem was not corrected. I rely on coding already done by other people and also by me for some additions.
I tested everything with these updates and the result is really great.
For example, I redid all the codes of all the monsters and this has corrected a lot of bug.
Actions are more fluid for each animation.
General kills codes are fixed.
Etc...
This post has been edited by Firefly_Trooper: 10 December 2018 - 09:32 AM
Needless question, I corrected everything. I just reversed the "ai" SHOOT and RUN and simply added in the code "state hit" the spritepal. So, it is not useful to add several spritepal 3 in the code.
By cons, I have a problem without explanation. The BOSS1 and BOSS2, work very well with "spritepal 3 and 22" except that I can not destroy the corpses (only in spritepal 22). Here, the BOSS3 does not activate the two actions "spritepal 3 and 22" I have either, even having coded in the same way.
Result two BOSS problems to finish.
1. jibbed corpses (spritepal 3)
2. activate two actions for the BOSS3 (spritepal 3 and 22).
As I have advanced with the monsters (especially the GAME.CON file), I would like to put the small problems of BOSS to later.
So I decided to code this famous flame thrower of the WT. just the first tutorial finished, I have some problems that I do not understand.
I will start with video tests:
WT
Personal con file
Here is my first part of the code:
gamevar WEAPON9_FLAGS 4 1
gamevar WEAPON9_FIREDELAY 4 1
gamevar WEAPON9_TOTALTIME 16 1
gamevar WEAPON9_HOLDDELAY 0 1
gamevar WEAPON9_FIRESOUND FLAMETHROWER_INTRO 1
state initweapondisplay
setvar angvar 0
setvar orientation 0
subvarvar digx looking_angSR1
addvarvar digy looking_arc
subvarvar digy gun_pos
addvarvar digx weapon_xoffset
setvarvar shade gs
getsector[THISACTOR].floorpal pal
ifvarg pal 13 setvar pal 0
ends
state flamethrower
switch weaponcount
case 0 case 1
setvar digz 65536
setvar digx 210
setvar digy 261
setvar picnum 5138
setvar orientation 0
state initweapondisplay
rotatesprite digx digy digz angvar picnum shade pal orientation 0 0 xdim ydim
break
case 2
setvar digz 65536
setvar digx 200
setvar digy 277
setvar picnum 5139
setvar orientation 0
state initweapondisplay
rotatesprite digx digy digz angvar picnum shade pal orientation 0 0 xdim ydim
break
case 3
setvar digz 65536
setvar digx 200
setvar digy 277
setvar picnum 5139
setvar orientation 0
state initweapondisplay
rotatesprite digx digy digz angvar picnum shade pal orientation 0 0 xdim ydim
break
case 4
setvar digz 65536
setvar digx 200
setvar digy 277
setvar picnum 5139
setvar orientation 0
state initweapondisplay
rotatesprite digx digy digz angvar picnum shade pal orientation 0 0 xdim ydim
break
endswitch
ends
state flamethrowerfire
switch weaponcount
case 2
setvar digz 65536
setvar digx 200
setvar digy 251
setvar picnum 5141
setvar orientation 0
state initweapondisplay
rotatesprite digx digy digz angvar picnum shade pal orientation 0 0 xdim ydim
break
case 3
setvar digz 65536
setvar digx 200
setvar digy 251
setvar picnum 5142
setvar orientation 0
state initweapondisplay
rotatesprite digx digy digz angvar picnum shade pal orientation 0 0 xdim ydim
break
case 4
setvar digz 65536
setvar digx 200
setvar digy 251
setvar picnum 5140
setvar orientation 0
state initweapondisplay
rotatesprite digx digy digz angvar picnum shade pal orientation 0 0 xdim ydim
break
endswitch
ends
state flamethrowerpilot
switch weaponcount
case 0 case 1
setvar digz 65536
setvar digx 211
setvar digy 261
setvar picnum 5174
setvar orientation 0
state initweapondisplay
rotatesprite digx digy digz angvar picnum shade pal orientation 0 0 xdim ydim
break
endswitch
ends
onevent EVENT_DRAWWEAPON
ifvare currentweapon 9
{
setvar RETURN -1
state flamethrowerpilot
state flamethrower
state flamethrowerfire
}
endevent
The problems encountered:
1. I really do not know what to choose in the codes "gamevar WEAPON"
2. The weapon does not vibrate when shooting.
3. During the firing time, the weapon's weapon does not stay long (as on the WT video).
4. The display of the weapon on the screen is in two parts (tiles 5139 to 5142). When she moves with the player, while shooting with it, the two images of the weapon separate slightly (a cut line is created).
Of course, I remain very enthusiastic to progress and, above all, to understand what to choose as a specific weapon.
As the coding of a new weapon is pretty boring, I'll come back to it a little later. Let's go back to the BOSS2 and BOSS3 code. Do you have an idea for spritepal problems?
All BOSS spritepal codes is fixed ! All BOSS jibbed corpses is fixed (with spritepal 3).
I take advantage of it to make a special LIZTROOP. A "super LIZTROOP"
Description:
1. health point 300
2. movement speed 150 (ground and jetpack)
3. has shield that can release.
4. is far more resistant to explosions (with spriteflags)
5. His weapon is expander with gust of fire in 12 shots (very deadly!)
6. Is absolutely not affected by the Shrinker.
7. He releases ammunition from the expander
optional:
8. all sounds have been changed (RECOG, ROAM, HURT and DIE)
9. spritepal 23
10. Do everything to avoid projectiles (like the drone).
This post has been edited by Firefly_Trooper: 16 December 2018 - 08:06 AM
1. A shrunken monster, will not be able to crush Duke who is also shrunk.
2. Shrunk monsters will no longer be able to generate items. The appearance of a large sprite of weapon / ammunition, generated by a shrunken monster is not consistent as well as the appearance of a sprite that has been reduced, is supposed not to be usable for a large Duke.
I have two more questions to finish the Shrinker related codes.
How to cancel the boot print in a bloodpool and how to cancel the animation frame of its reduced size?
When Duke walks on a bloodpool, his height decreases. I would just like to cancel these actions only for shrunken monsters. I would choose the size of the bloodpool myself. If these actions are not canceled, the bloodpool is bugged because it will want to decrease.
This post has been edited by Firefly_Trooper: 16 December 2018 - 12:08 PM
I found in the wiki, the code that prevents the damage that the actors inflict themselves. But I have not yet found a code that prevents an actor from firing projectiles without them seeing the player.
Another corrected contribution in my work. The boss of NW is completely redone and the bugs are fixed.
I just have one last thing to code and it concerns the guts. How to correctly code two sprites to add them in my new tripe code? I have two original "jibs" from "Santa Claus"
I created a definition, actions and a new actor for these two sprites.
The only concern is how to fall on the floor, the sprites of a tripe code?
This post has been edited by Firefly_Trooper: 18 December 2018 - 01:01 PM
I have another frame for the PIGCOP: looking at the number 2030, he is standing shooting. I wanted to use this tile, to create a new action or the Pigcop draws directly by seeing the player (similar to PICOPDIVE).
Everything works fine except the "action" animation frame. I can not define tiles for "action" animation. This shifts the images, as if it was the number "PIGCOPDIVE 2045" everything is played as if it was PIGCOPDIVE while I changed everything.
How to force an actor to animate the frame of action?
Its hard to find the problems without all the other code for the pigcop such as the defs to make sure the anims are correct. I also see that most of the code you posted is the creation of a state. But there is no call to use the state inside the actor. Maybe that call is in another part of the code not shown?
Before I look at all the code I will ask again about any def files lines to make sure those new PIGSTANDSHOOT tiles are properly defined. If they were not used in the original game its possible they do not have any defs. As a test I would add my own lines in a def file just to make sure they are defined. Your actions won't work unless those tiles are defined properly first. If they still don't work, then its time to look at the rest of your code.
EDIT: I loaded up Mapster and saw that there are dummytile dimensions and offsets for those tiles so I'm guessing they are defined properly. So on to the code...
This post has been edited by Mark: 19 December 2018 - 02:26 PM
1. New frame tile location (2080 instead of 2030)
2. News actions
3. New AI
4. New state
5. AI and state added in the general code
6. New actor (useractor)
7. Automatic resize
8. RECOG sound added
Only small problem related to the frame: I can not have again, shooting animation. What remains to be defined is the actions of killing, shrinking, freezing, etc ... within the general code.