
EDuke32 Scripting "CON coding help"
#2963 Posted 14 August 2022 - 01:00 PM
#2964 Posted 14 August 2022 - 01:18 PM
if that doesnt work, create your own pickup actor, and let it give you whatever ammo you need to get from it.
This post has been edited by jimbob: 14 August 2022 - 01:19 PM
#2965 Posted 14 August 2022 - 02:14 PM
#2966 Posted 16 August 2022 - 09:56 AM
#2967 Posted 16 August 2022 - 12:10 PM
VGames, on 16 August 2022 - 09:56 AM, said:
You can cancel the hardcoded drawing of the weapon by setting to RETURN to -1 in the weapon drawing event (EVENT_DISPLAYWEAPON or EVENT_DRAWWEAPON). Then you can use rotatesprite and other commands to draw the weapon or whatever else you want to draw on to the screen wherever you want it to be drawn. And that is really the only answer I can give you. There is no simple hack or setting of a variable to make a weapon come in from the side instead of the bottom.
#2968 Posted 16 August 2022 - 12:13 PM
#2969 Posted 16 August 2022 - 06:25 PM
#2970 Posted 21 August 2022 - 01:37 PM
in the CHANGEWEAPON EVENT I'm using this to set up the wait:
ifvare player[].curr_weapon HANDBOMB_WEAPON setvar SwitchTime6 20 ifvare player[].curr_weapon TRIPBOMB_WEAPON setvar SwitchTime9 20
in the DISPLAYWEAPON EVENT I got this to make them play the proper animation when their specific SwitchTime variable is active:
ifvarg SwitchTime6 0 state draw_LSFire1 ifvarg SwitchTime9 0 state draw_4HFire
Now both SwitchTime6 and 9 get reduced by 1 every tick when above 0 I just didn't show that part of the code. This code works good unless you're switching between both weapons. I didn't include all the various sets of script I tried out to try and get them to wait on each other. They were all worthless. Please help if you can.
This post has been edited by VGames: 21 August 2022 - 01:40 PM
#2971 Posted 21 August 2022 - 01:59 PM
In cases where the coder doesn't know what is going on or causing the issue, I kind of have to discount what they are saying about it since what they are saying could include false assumptions. So I can't go by your descriptions, only the actual code, and you didn't include the main part of your code. I don't have time anyway though.
#2972 Posted 21 August 2022 - 02:48 PM
Danukem, on 21 August 2022 - 01:59 PM, said:
In cases where the coder doesn't know what is going on or causing the issue, I kind of have to discount what they are saying about it since what they are saying could include false assumptions. So I can't go by your descriptions, only the actual code, and you didn't include the main part of your code. I don't have time anyway though.
I didn't think I should post all the code here. I'll post a link for the file itself if anybody is interested.
https://www.mediafir...EAPONS.con/file
#2973 Posted 25 August 2022 - 05:59 PM
----------------------------------------------------------------------------- Summary : Combat arena management and spawning. Arena Managers act like Touchplates, activating when a player enters their sector. Arena Spawn Points act like Respawns, except they can spawn multiple times. Once activated, a Manager will attempt to trigger their paired Spawn Points in waves on a repeating cycle. Each wave, a Spawn Point will only trigger if its spawned child is dead, otherwise it will be skipped. Spawn Points will continue spawning until their "tickets" run out. For example, if an arena has 5 Spawn Points but 2 enemies are left alive, the next wave will only spawn 3 enemies, but only if each of those 3 Spawn Points have remaining tickets. For Arena Managers: * Set the sprite's HITAG to the spawn wave frequency, in game tics (min 90) For Arena Spawn Points: * Set the sprite's HITAG to the tile ID to spawn * Set the sprite's LOTAG to the number of spawn "tickets" (min 1) Use the palette to pair a Manager with Spawn Points to create a complete system. A Manager can have any number of associated Spawn Points, and there can be as many Manager systems as there are palette numbers. Note: Spawn Points will not spawn if a player has line-of-sight with them, so place them in non-visible locations, and try not to place other Spawn Points within line-of-sight of each other to prevent the system from dead locking! -----------------------------------------------------------------------------
This manager largely works by abusing EVENT_WORLD and custom statnums to reduce overhead. I am pretty proud of this effect and its elegance, and unfortunately it didn't get used as much in AWOL as I had hoped, so hopefully it gains more life in someone else's project.
This code won't run as-is, you'll need to setup gamevars and remove or fix some AWOL-specific code/vars outside the scope of this file. No support will be provided for this code.
Attached File(s)
-
enemy_arena.con (6.38K)
Number of downloads: 208
#2975 Posted 03 September 2022 - 01:25 PM
#2976 Posted 03 September 2022 - 01:42 PM
VGames, on 03 September 2022 - 01:25 PM, said:
https://wiki.eduke32...iki/Spriteflags
Make sure to apply the NOSHADE flag to the sprite before applying shade.
#2977 Posted 03 September 2022 - 05:10 PM
Danukem, on 03 September 2022 - 01:42 PM, said:
Make sure to apply the NOSHADE flag to the sprite before applying shade.
Oh ok. Thanks. I misunderstood the use of this flag.
#2978 Posted 10 September 2022 - 10:01 AM
Sangman, on 10 February 2020 - 06:44 AM, said:
I'm working on a few performance related things and just want to corroborate this behavior, and I'm not sure if this is a bug in the implementation of EVENT_RESETGOTPICS or if this event is explicitly meant to function only with mirrors. Based on the description and comments in the source code, I assumed it would fire every frame after EVENT_DISPLAYROOMS, but it only seems to be fired when mirror rendering logic is happening. So if you want to reset the gotpic array independent of mirror logic, it seems to be safest to do in a DISPLAYROOMS event after all other DISPLAYROOMS events have been executed, or in any other event that runs after DISPLAYROOMS.
Danukem, on 10 February 2020 - 09:44 AM, said:
Based on a quick test using the above info, sprites are rendered (or at least, inserted into the gotpic array) even if they are not explicitly on screen, based on A.) if the sprite's sector is being rendered AND B.) if the sprite is within the player's field of vision. Using the example image below, if the player were in the top left of each U, the sprite on the left room would always be rendered no matter where the player is located, as long as the player is facing in its direction, even though the walls block it from being seen. But the sprite in the right room would never be rendered until the player gets in the bottom left corner sector, at which point the sprite's sector begins to be rendered and it begins to follow those rules.

Basically, if you understand how sector rendering is performed, any sprite in a rendered sector will always be drawn if the sprite's location is within the player's field of vision, even if walls block it from being seen. One-way mask walls would presumably prevent this as they function as white walls during rendering, although I didn't test this here.
#2979 Posted 10 September 2022 - 10:55 AM
I just tried using the htflags 2048 on the missiles when they're within a certain range of the player to make them clip through him but that didn't work either.
This post has been edited by VGames: 10 September 2022 - 11:07 AM
#2980 Posted 10 September 2022 - 11:01 AM
#2981 Posted 10 September 2022 - 12:31 PM
VGames, on 10 September 2022 - 10:55 AM, said:
I just tried using the htflags 2048 on the missiles when they're within a certain range of the player to make them clip through him but that didn't work either.
This is one of those situations where offsets just don't cut it. You have to intervene at the instant the rockets spawn in EVENT_EGS and manually reposition the x and y coordinates. I find the rotatepoint command useful for calculating the new coordinates in these situations.
#2982 Posted 10 September 2022 - 12:40 PM
jimbob, on 10 September 2022 - 11:01 AM, said:
Typically when an enemy uses that state, it is facing towards the player and the back of the enemy is facing towards the wall that get bloodied. So maybe those hardcoded wall splat projectiles have a big angle offset and come out the backside of the sprite shooting them. Therefore, I would try making your projectile turn 1024 build degrees right before shooting those blood splats and deleting itself.
#2983 Posted 10 September 2022 - 01:38 PM
Danukem, on 10 September 2022 - 12:31 PM, said:
Will do. Thanks a lot
#2984 Posted 11 September 2022 - 10:24 AM
Danukem, on 10 September 2022 - 12:40 PM, said:
i already tried that, including some other angles ( 512 and others ) making the sprite spin seems to work so there is definatly a offset involved but finding the right angle seems to be rather difficult. i could always try to make increments in angle offset of about 32 units untill i hit the sweet spot.
[edit] trying to rotate the sprite didnt seem to work, there is probably something else going on in the code. so i hacked it by making a move command and using faceplayer. its a hack but it seems to work

This post has been edited by jimbob: 11 September 2022 - 10:53 AM
#2985 Posted 11 September 2022 - 10:33 AM
ifactor ID_ALT1 { rotatepoint player[].posx player[].posy 100 player[].posy player[].ang temp tempb setsprite THISACTOR temp player[].posy player[].posz }
No matter what I set that 100 to the missile simply does not show up. Even if I set it to 0. What am I doing wrong? This is in the EGS event.
#2987 Posted 14 September 2022 - 05:44 AM
#2988 Posted 14 September 2022 - 11:06 AM
VGames, on 14 September 2022 - 05:44 AM, said:
It is very hardcoded
#2989 Posted 15 September 2022 - 05:44 PM
#2990 Posted 15 September 2022 - 09:07 PM
#2991 Posted 16 September 2022 - 04:25 AM
Danukem, on 16 June 2009 - 11:01 AM, said:
That would be fine if that’s the best that can be achieved. My work around so far was to have the drops disappear if the player got within a certain distance of them. This is ok but I’d really like the drops to fall right in front of the players face sometimes and with this method I have to set the distance to 2000 or more to keep them from landing on his head. So it looks weird sometimes when they simply disappear mid air. But if they simply disappeared when contacting the player that would be even better. How would I go about doing this?
This post has been edited by VGames: 16 September 2022 - 04:27 AM
#2992 Posted 16 September 2022 - 12:06 PM
VGames, on 16 September 2022 - 04:25 AM, said:
This is more difficult than it should be. There is no direct way to tell if a sprite is falling onto the player. The getzrange command can be used for this, though. I have had success with it.
https://wiki.eduke32.../wiki/Getzrange
You'll have to examine the floorhit return value to see if the player is being hit, and then compare the floorz return value to the height of the falling sprite and have it delete itself if the z distance is short enough.