![](https://forums.duke4.net/public/style_images/cgs/_custom/switch.png)
EDuke32 Scripting "CON coding help"
#1741 Posted 10 October 2015 - 12:21 PM
#1742 Posted 10 October 2015 - 12:44 PM
Fox, on 10 October 2015 - 12:21 PM, said:
D'Oh ! Yes, I just discovered that. It was odd because I spawned tile 764 (building sprite) and nothing appeared, however using DNDEBUG and loading debug.map it DID appear in mapster when in 2-D mode and even drew "correctly" (as in how I expected it not realising about xrepeat) in 2D mode (when you press the [backspace] key to show textures in 2D mode).
Perhaps Mark could supply a test map giving the idea of the complexity of the areas he is dealing with. There would be lots of corner cases in spawning copies but if those corner cases 'aint going to happen in reality then things could be kept relatively simple. For exampe, xoffset is a fairly coarse adjustment so it is conceivable that you can't actually position the duplicate in the sector you want.
TTFN,
Jon
This post has been edited by The Mechanic: 10 October 2015 - 12:46 PM
#1743 Posted 10 October 2015 - 12:58 PM
EDIT: I re-read my post. Its looking even more impossible to implement. Never mind.
![:)](https://forums.duke4.net/public/style_emoticons/default/smile.gif)
This post has been edited by Mark.: 10 October 2015 - 01:03 PM
#1744 Posted 10 October 2015 - 02:01 PM
Mark., on 10 October 2015 - 12:58 PM, said:
I like the lateral thinking ! Suspect rendering a different view from the position deciding what to render may be a world of pain coding-wise, depends on how tightly coupled things are I guess.
Mark., on 10 October 2015 - 12:58 PM, said:
![:)](https://forums.duke4.net/public/style_emoticons/default/dukecry.gif)
Aww, you give up to easy
![:)](https://forums.duke4.net/public/style_emoticons/default/smile.gif)
TTFN,
Jon
This post has been edited by The Mechanic: 10 October 2015 - 02:01 PM
#1745 Posted 10 October 2015 - 02:20 PM
This post has been edited by Mark.: 10 October 2015 - 02:26 PM
#1746 Posted 10 October 2015 - 04:01 PM
For set dressing where collision isn't important it might work, but it's just an idea and could fail spectacularly if it (the engine) does any checks after that event triggers.
#1747 Posted 10 October 2015 - 05:26 PM
If you want to force all sprites to be rendered, you can use this:
gamevar Temp1 0 0 gamevar Temp2 0 0 gamearray TempSectnum 16384 appendevent EVENT_DISPLAYSTART ifvarn rendmode 0 ifvare Temp1 0 { setvar Temp2 0 whilevarvarn Temp2 16384 { ifvarn sprite[Temp2].statnum MAXSTATUS { setarray TempSectnum[Temp2] sprite[Temp2].sectnum setactor[Temp2].sectnum camerasect } addvar Temp2 1 } setvar Temp1 1 } endevent appendevent EVENT_DISPLAYREST ifvarn rendmode 0 ifvare Temp1 1 { setvar Temp2 0 whilevarvarn Temp2 16384 { ifvarn sprite[Temp2].statnum MAXSTATUS setactor[Temp2].sectnum TempSectnum[Temp2] addvar Temp2 1 } setvar Temp1 0 } endevent
But there are some issues with this solution:
- It works by changing the current sector to that of the camera view after the game worlds is processed, but before animatesprites. Thus sprites shade, palette or visibility depends on the current camera sector.
- You can see everything from the map through parallaxed skies.
- If there are two sectors occupying the same space, you can see the sprites from one sector on another.
- Always rendering all sprites (or models) it will consume too much CPU. Sprites disappearing is an intended effect afterall.
#1748 Posted 10 October 2015 - 06:07 PM
Its been a long day at the computer. I'll try out your code tomorrow. Thanks.
This post has been edited by Mark.: 10 October 2015 - 06:13 PM
#1749 Posted 10 October 2015 - 07:47 PM
#1750 Posted 11 October 2015 - 12:13 AM
Fox, on 10 October 2015 - 05:26 PM, said:
.... appendevent EVENT_DISPLAYSTART ifvarn rendmode 0 ...
I'm curious, why woudn't this work in rendermode 0 ?
TTFN,
Jon
This post has been edited by The Mechanic: 11 October 2015 - 12:15 AM
#1751 Posted 11 October 2015 - 03:04 AM
// Eduke """"feature"""": 'movesprite' only moves half way, so double delta values mulvar temp1 2 mulvar temp2 2 mulvar temp3 2 // Loop through all sprites in group and move by delta's setvarvar temp4 THISACTOR whilevarn temp4 -1 { // Current pos becomes previous pos getactor[temp4].x temp5 setactor[temp4].htbposx temp5 getactor[temp4].y temp5 setactor[temp4].htbposy temp5 getactor[temp4].z temp5 setactor[temp4].htbposz temp5 // Move da sprite movesprite temp4 temp1 temp2 temp3 0 RETURN // If player 0 was standing on it then move player too - TODO : Multiplayer,enemies... setvar temp5 0 getplayer[temp5].sbs temp5 ifvarvare temp5 temp4 { divvar temp1 2 divvar temp2 2 divvar temp3 2 setvar RETURN 0 getplayer[RETURN].posx temp5 setplayer[RETURN].oposx temp5 addvarvar temp5 temp1 setplayer[RETURN].posx temp5 getplayer[RETURN].posy temp5 setplayer[RETURN].oposy temp5 addvarvar temp5 temp2 setplayer[RETURN].posy temp5 getplayer[RETURN].posz temp5 setplayer[RETURN].oposz temp5 addvarvar temp5 temp3 setplayer[RETURN].posz temp5 updatesectorz player[RETURN].posx player[RETURN].posy player[RETURN].posz temp5 setplayer[RETURN].cursectnum temp5 mulvar temp1 2 mulvar temp2 2 mulvar temp3 2 } getactorvar[temp4].nextsprite temp4 }
When viewing the sprites in motion they are moving nice and smooth in all three dimensions. When Duke is carried on the sprites he also seems to move smoothly judging by the scenery but the group of sprites have a small bobbing up-and-down motion with a cycle of 1 second.
Is there a better way of moving the player ?
TTFN,
Jon
#1752 Posted 11 October 2015 - 03:29 AM
The Mechanic, on 11 October 2015 - 12:13 AM, said:
TTFN,
Jon
No reason, I was just thinking of a hack for models.
#1753 Posted 11 October 2015 - 04:11 AM
This post has been edited by Mark.: 11 October 2015 - 04:11 AM
#1754 Posted 11 October 2015 - 05:50 AM
This post has been edited by Mark.: 11 October 2015 - 06:58 AM
#1755 Posted 11 October 2015 - 07:31 AM
#1756 Posted 11 October 2015 - 07:36 AM
This post has been edited by Mark.: 11 October 2015 - 07:47 AM
#1757 Posted 11 October 2015 - 01:17 PM
Fox, on 11 October 2015 - 07:31 AM, said:
Indeed I'm busy at the moment--from what I understand skimming the conversation, you're talking about always rendering sprites regardless of what sector they're in, for stuff like model-based terrain? It's been talked about before, and I'm going to be working in that area of the renderers for some Duke 64 stuff.
If you clarify to me what the request is, I can add it to the mental pipeline to implementation.
#1758 Posted 11 October 2015 - 02:02 PM
#1759 Posted 12 October 2015 - 09:04 AM
Mblackwell, on 09 October 2015 - 02:22 PM, said:
I must've done something horribly wrong, since the placement of pstomp doesn't change a thing. Yes, I think I tried all the possible placement and the whole code I have written is just bad.
#1760 Posted 12 October 2015 - 10:16 AM
December Man, on 12 October 2015 - 09:04 AM, said:
pstomp begins a sequence which results in the deletion of the sprite that is issuing the command. It is NOT used in conjunction with killit, in any order. You either use pstomp to delete the sprite, or you use killit, you do not use both. If you have any questions, look at how it is used in an unmodified GAME.CON, or look at the source code.
#1761 Posted 12 October 2015 - 10:45 AM
#1762 Posted 13 October 2015 - 11:26 PM
Alternatively, is there a way to compile a .grp that handles like a shareware copy of Duke3D?
#1765 Posted 14 October 2015 - 10:31 PM
It was just something I was curious about. I remember a long time ago trying to edit the shareware version of the game so I could release it standalone and any tampering with the grp resulted in the game thinking you were trying to run a full version.
#1766 Posted 25 October 2015 - 01:03 PM
From examining the existing GAME.CON I've found:
COOLEXPLOSION1 FIREEXT FIRELASER FREEZEBLAST GROWSPARK KNEE RADIUSEXPLOSION RPG SHRINKSPARK SHOTSPARK1
Whilst the names of some of the weapons used in GAME.CON are obvious, some are not. SHOTSPARK1 appears to be both pistol and shotgun (so it seems you can't differentiate the two). As for COOLEXPLOSION1, looking through the code I thought COOLEXPLOSION1 was the octobrain's, er, whatever it's shot is called but it also appears to be fired by BOSS2 !?
Perhaps the Eduke wiki maintainer could update the relevent page.
TTFN,
Jon
PS: Also curious about FIREEXT, what is it ? I thought it might be the fire extinguisher but that actually appears (quite logically) as weapon RADIUSEXPLOSION. FIREEXT is only used in one place - in the player's code - where it simply duplicates the effect of a RADIUSEXPLOSION.
This post has been edited by The Mechanic: 25 October 2015 - 01:03 PM
#1767 Posted 25 October 2015 - 01:39 PM
http://wiki.eduke32....for_ifwasweapon
You can also theoretically check for SHOTGUN and CHAINGUN, which is just a shotspark1 actor with its extra/damage value defined by those constants.
#1768 Posted 25 October 2015 - 02:59 PM
Mblackwell, on 25 October 2015 - 01:39 PM, said:
Cheers !
I did have a good search first but did not locate that section.
So, I'll modify my previous request to the Eduke wiki maintainer to add a link to this information from the ifwasweapon wiki page.
Mblackwell, on 25 October 2015 - 01:39 PM, said:
Out of curiosity how does an actor get access to this data (e.g. extra) for the weapon ?
TTFN,
Jon