CON coding problems. "Improvements and progress."
#211 Posted 01 April 2019 - 04:13 PM
There are two things left to settle.
1. Stop the attack when Duke is dead. Maybe I have to use this: "ifp pdead and break"
2. The monster does not stop anymore, even when Duke is far away and hidden (search stop). Maybe this?: "sleeptime"
#212 Posted 02 April 2019 - 11:38 AM
Firefly_Trooper, on 01 April 2019 - 04:13 PM, said:
It's better:
ifp palive { do things }
Firefly_Trooper, on 01 April 2019 - 04:13 PM, said:
I think "sleeptime" should work.
#213 Posted 03 April 2019 - 09:36 AM
I still have not been able to correct the two simple problems of King Cobra and Predator.
Otherwise, fixed the monsters codes of Nuclear.
#214 Posted 05 April 2019 - 08:43 AM
Loading on YouTube is slow because the demo is between 6 and 10GB.
I also fixed the death of all the enemies of the expander weapon.
I removed the gamevar "KILLCOUNTFIX" inside the codes of the enemies, and I added it simply in the code EVENT_KILLIT. The value of the counter will be taken into account only when the enemies explodes.
Femcode fixed. It will just remain to add BDP women to reduce them to shrinker.
This post has been edited by Firefly_Trooper: 05 April 2019 - 08:45 AM
#215 Posted 06 April 2019 - 02:46 PM
gamevar NEWSWITCH 0 2 onevent EVENT_LOADACTOR switch sprite[THISACTOR].picnum case PROTO_SLOTDOOR setvarvar NEWSWITCH sprite[THISACTOR].lotag getactor[THISACTOR].lotag 0 break endswitch endevent useractor notenemy PROTO_SLOTDOOR ifpdistl 1024 ifp pfacing ifhitspace { cactor 7029 sound SWITCH_ON ifvarg NEWSWITCH 0 { operateactivators NEWSWITCH setvar NEWSWITCH 0 } } enda
#216 Posted 07 April 2019 - 05:29 AM
Also don't set variable NEWSWITCH to 0 after use, if you want to use your switch several times.
EDIT: Here's a quick example, it should show you how using 'action' command, and also handle 'use' key (not tested)
action ASWITCHOFFA 0 action ASWITCHOFFB 0 action ASWITCHONA 1 action ASWITCHONB 1 useractor notenemy PROTO_SLOTDOOR ifaction 0 action ASWITCHOFFB ifpdistl 1024 ifp pfacing { ifhitspace { ifaction ASWITCHOFFB { sound SWITCH_ON ifvarg NEWSWITCH 0 operateactivators NEWSWITCH 0 action ASWITCHONA } else ifaction ASWITCHONB { sound SWITCH_ON ifvarg NEWSWITCH 0 operateactivators NEWSWITCH 0 action ASWITCHOFFA } } else { ifaction ASWITCHOFFA action ASWITCHOFFB else ifaction ASWITCHONA action ASWITCHONB } } enda
EDIT 2: Don't forget there's also operatemasterswitches
This post has been edited by Darkus: 07 April 2019 - 05:50 AM
#217 Posted 07 April 2019 - 08:33 AM
I completely forgot to add the actions.
Aside from that, I did my demo again in a 46-minute video and "fucking it was good" to play this game with all these patches and all the new additions, was an excellent experience. The game is even more awesome than in my memories lol.
Of course, there is still more to do. Once the video is published, I will share my files.
And all this is thanks to the community of the forum. Thanks guys !
#218 Posted 08 April 2019 - 08:07 AM
I have one last question for that. How to add a different sound in the hitag? Do we have to add a soundvar ?
How to also know the exact distance when activating a switch?
#219 Posted 09 April 2019 - 12:18 PM
Firefly_Trooper, on 08 April 2019 - 08:07 AM, said:
It's the same way you did with 'hitag' for dropping items, copy the value into the variable in 'EVENT_LOADACTOR', and play the sound using 'soundvar' with the variable
Firefly_Trooper, on 08 April 2019 - 08:07 AM, said:
ifpdistl should suffice. The more you increase the value, the more you can activate the switch from greater distance.
#221 Posted 10 April 2019 - 07:42 AM
Morter projectile of Captain Gorilla is fixed. It was a problem of clipdist.
Also RPG projectile of Mini-Battlelord is fixed.
Flying Frosty is fixed. He no longer attacks when Duke is dead, he moves without problems and he uses sleep in a natural way.
#224 Posted 11 April 2019 - 02:45 PM
Darkus, on 09 April 2019 - 12:18 PM, said:
ifpdistl should suffice. The more you increase the value, the more you can activate the switch from greater distance.
I think I forgot something again.
I created this:
soundvar SOUNDSWITCH sprite [THISACTOR] .lotag
And I put it in this code:
onevent EVENT_LOADACTOR switch sprite[THISACTOR].picnum case PROTO_SLOTDOOR setvarvar PROTO_SLOTDOOR sprite[THISACTOR].lotag break endswitch endevent
What is certain is that I misunderstood the instructions my dear Darkus.
#225 Posted 11 April 2019 - 05:33 PM
This post has been edited by Firefly_Trooper: 11 April 2019 - 05:35 PM
#226 Posted 12 April 2019 - 09:24 AM
I would like to show items, when an object is destroyed (like sprites "CANWITHSOMETHING").
Is this the same procedure as the code "RESPAWN" with the value hitag ?
I would also like at the same time, generate a single item, when a monster is killed.
It is no longer "RESPAWN" with the hitag, but the lotag. As if an enemy killed already drop ammunition and weapons, except that I would like to assign a single item for a single monster / object.
#227 Posted 18 April 2019 - 02:10 PM
They were as "actor" and were invincible. Changed to "useractor"
This post has been edited by Firefly_Trooper: 18 April 2019 - 02:19 PM
#228 Posted 18 April 2019 - 02:22 PM
I have a clipdist problem with the BOSS. I would like to set a weak clipdist (value of 40 for example), so that they can be narrowed without problem and a higher clipdist (80) to prevent them from walking in narrow passages.
This problem goes back several months and I have not always thought about how to solve this problem.
#229 Posted 30 April 2019 - 08:32 AM
Boss clipdist problem is not work.
#230 Posted 01 May 2019 - 03:03 AM
Small changes of quotes for weapons and items.
After making the code to make monsters appear, after killing them, I added the same function for all items that Duke picks up on the map.
#231 Posted 01 May 2019 - 12:43 PM
The ability to open, close, activate or deactivate a door, when an enemy is killed or when an item is picked up.
#233 Posted 01 May 2019 - 06:39 PM
I tried a lot of methods without result. I tried this:
appendevent EVENT_RECOGSOUND ifactor OCTABRAIN { set RETURN -1 stopsound OCTA_RECOG } ifactor OCTABRAINSTAYPUT { set RETURN -1 stopsound OCTA_RECOG } endevent
It works, except that the normal Octabrain also has no sound. I still have stopsoundvar, but I do not know how to use it.
#234 Posted 02 May 2019 - 04:24 AM
When I kill an enemy, it locks or unblocks a door without any problem.
The only thing that does not work is when I use a lotag beyond 3. From "lotag 4", the sprite disappears.
The code:
gamevar OPERATEDOOR 0 2 // doors operate code (with monsters and items) EVENT_LOADACTOR setvarvar OPERATEDOOR sprite[THISACTOR].lotag EVENT_KILLIT ifvarg OPERATEDOOR 0 { operateactivators OPERATEDOOR 0 }
have I forgotten something?
#235 Posted 03 May 2019 - 12:21 PM
The only concern is that the sound "SWITCH_ON" basic activates at the same time
#236 Posted 04 June 2019 - 04:06 PM
I will review the last problems that I gave up temporarily. I will start with the famous problem "RESPAWN" with the lotag.
#237 Posted 04 June 2019 - 04:49 PM
====01==== USE RESPAWN SPRITE
Method 01: appearance of monsters / items, when Duke kills an enemy (with hitag):
gamevar MRESPAWN 0 2 onevent EVENT_LOADACTOR // for enemy setvarvar MRESPAWN sprite[THISACTOR].hitag setactor[THISACTOR].hitag 0 onevent EVENT_KILLIT ifvarg MRESPAWN 0 { operaterespawns MRESPAWN setvar MRESPAWN 0 } // inside the enemy code for normal death with fast fire ifvarg MRESPAWN 0 { operaterespawns MRESPAWN setvar MRESPAWN 0 }
Method 02: appearance of monsters / items, when Duke finds a weapon, ammo and other items (with hitag):
gamevar ORESPAWN 0 2 onevent EVENT_LOADACTOR // for items setvarvar ORESPAWN sprite[THISACTOR].hitag // inside the items code ifvarg ORESPAWN 0 { operaterespawns ORESPAWN setvar ORESPAWN 0 }
====02==== NOT USE RESPAWN SPRITE
Method 03: appearance of monsters / items and opening doors, when Duke kills an enemy or finds an item at random (with lotag):
gamevar OPERATEDOOR 0 2 onevent EVENT_LOADACTOR setvarvar OPERATEDOOR sprite[THISACTOR].lotag onevent EVENT_KILLIT ifvarg OPERATEDOOR 0 { operateactivators OPERATEDOOR 0 } // inside the monsters / items code ifvarg OPERATEDOOR 0 { operateactivators OPERATEDOOR 0 }
t is precisely this method 03 that does not work correctly with the lotag. When I use a lotag beyond 5 or 6, the code stops working.
I would like to use something specific with this third method. Displaying an item directly on the killed enemy / object (trash or xmas tree) and not with the sprite "RESPAWN" the item that drops the enemy / object killed, is similar when they drop weapons or ammunition.
I would also like to be able to activate several doors to open or close, with this same code.
Here I think I have been pretty clear about my explanations.
This post has been edited by Firefly_Trooper: 04 June 2019 - 04:55 PM
#238 Posted 08 June 2019 - 11:53 AM
I had even the idea to define the size of the sprite BLOODPOOL about the shrinkage with the shrinker.
But before approaching that, I wish I could finish the coding of RESPAWN.
#239 Posted 17 June 2019 - 09:46 AM
I proceeded like this:
gamevar L_RESPAWN 0 2 // lotag "RESPAWN" for all monsters / items state lotag_code // special lotag "RESPAWN" code { getactor[THISACTOR].lotag OPERATEDOOR getactor[THISACTOR].lotag L_RESPAWN setactor[THISACTOR].lotag 0 } ends state lotag_code_items ifvare L_RESPAWN 21 { spawn FIRSTGUNSPRITE } ifvare L_RESPAWN 22 { spawn CHAINGUNSPRITE } ifvare L_RESPAWN 23 { spawn RPGSPRITE } ifvare L_RESPAWN 24 { spawn FREEZESPRITE } ifvare L_RESPAWN 25 { spawn SHRINKERSPRITE } ifvare L_RESPAWN 26 { spawn HEAVYHBOMB } ifvare L_RESPAWN 27 { spawn TRIPBOMBSPRITE } ifvare L_RESPAWN 28 { spawn SHOTGUNSPRITE } ifvare L_RESPAWN 29 { spawn DEVISTATORSPRITE } ifvare L_RESPAWN 32 { spawn GROWSPRITE } ifvare L_RESPAWN 37 { spawn FREEZEAMMO } ifvare L_RESPAWN 40 { spawn AMMO } ifvare L_RESPAWN 41 { spawn BATTERYAMMO } ifvare L_RESPAWN 42 { spawn DEVISTATORAMMO } ifvare L_RESPAWN 44 { spawn RPGAMMO } ifvare L_RESPAWN 45 { spawn GROWAMMO } ifvare L_RESPAWN 46 { spawn CRYSTALAMMO } ifvare L_RESPAWN 47 { spawn HBOMBAMMO } ifvare L_RESPAWN 48 { spawn AMMOLOTS } ifvare L_RESPAWN 49 { spawn SHOTGUNAMMO } ifvare L_RESPAWN 51 { spawn COLA } ifvare L_RESPAWN 52 { spawn SIXPAK } ifvare L_RESPAWN 53 { spawn FIRSTAID } ifvare L_RESPAWN 54 { spawn SHIELD } ifvare L_RESPAWN 55 { spawn STEROIDS } ifvare L_RESPAWN 56 { spawn AIRTANK } ifvare L_RESPAWN 57 { spawn JETPACK } ifvare L_RESPAWN 59 { spawn HEATSENSOR } ifvare L_RESPAWN 60 { spawn ACCESSCARD } ifvare L_RESPAWN 61 { spawn BOOTS } ifvare L_RESPAWN 100 { spawn ATOMICHEALTH } ifvare L_RESPAWN 101 { espawn ACCESSCARD setactor[RETURN].pal 21 } ifvare L_RESPAWN 102 { espawn ACCESSCARD setactor[RETURN].pal 23 } ends eventloadactor LIZTROOP // special lotag "RESPAWN" code for all enemies state lotag_code enda eventloadactor LIZTROOPRUNNING state lotag_code enda eventloadactor LIZTROOPSTAYPUT state lotag_code enda eventloadactor LIZTROOPSHOOT state lotag_code enda eventloadactor LIZTROOPJETPACK state lotag_code enda eventloadactor LIZTROOPONTOILET state lotag_code enda eventloadactor LIZTROOPJUSTSIT state lotag_code enda eventloadactor LIZTROOPDUCKING state lotag_code enda state lotag_code_items // inside the Liztroop's code, for the various death
It works very well and it avoids copying the long list of items. It just misses the command "break" to avoid showing an item, when a monster is shrunk.
This post has been edited by Firefly_Trooper: 17 June 2019 - 09:49 AM