
EDuke32 Scripting "CON coding help"
#2154 Posted 07 November 2017 - 09:51 AM
This post has been edited by spacekebab: 07 November 2017 - 09:51 AM
#2155 Posted 07 November 2017 - 01:42 PM
spacekebab, on 07 November 2017 - 09:51 AM, said:
It's hardcoded. You can tell by searching GAME.CON that there is no actor script for it. But what you could do is declare it as an actor, and then make it run state breakobject or something similar. You may have to force it to statnum 1 though.
#2156 Posted 15 November 2017 - 12:00 PM
Problem is that it's also used for a lot of other things where the hightile would look out of place, so I got the idea to only assign it based on a generally unused pallet in the DEF file, then change the texture's pallet via con based on certain conditions (eg if it's being used as a sky texture on a paralaxed ceiling). The code I wrote works, but not really. It's all dependent on the player, so the sky's pallet ONLY changes when the player enters that sector which makes enough sense, but for obvious reasons i can't have it work that way. I'm not sure how to make that change happen independent of the player though.
This post has been edited by CruX: 15 November 2017 - 12:12 PM
#2157 Posted 15 November 2017 - 01:05 PM
CruX, on 15 November 2017 - 12:00 PM, said:
Problem is that it's also used for a lot of other things where the hightile would look out of place, so I got the idea to only assign it based on a generally unused pallet in the DEF file, then change the texture's pallet via con based on certain conditions (eg if it's being used as a sky texture on a paralaxed ceiling). The code I wrote works, but not really. It's all dependent on the player, so the sky's pallet ONLY changes when the player enters that sector which makes enough sense, but for obvious reasons i can't have it work that way. I'm not sure how to make that change happen independent of the player though.
Wouldn't it make more sense to use mapster script and just fix the map?
If you want to do it via CON, you could use code like this:
onevent EVENT_ENTERLEVEL set temp 0 whilevarvarn temp NUMSECTORS { ife sector[temp].ceilingpicnum 199 ifvarand sector[temp].ceilingstat 1 setsector[temp].ceilingpicnum MYHIGHTILECEILING add temp 1 } endevent
That code doesn't do anything with palettes, but you can easily add a condition that checks ceilingpal, or you could change ceilingpal instead of changing ceilingpicnum.
#2158 Posted 15 November 2017 - 01:30 PM
Trooper Dan, on 15 November 2017 - 01:05 PM, said:
Maybe? I'm not with familiar mapster script, just working within the boundaries of things I (vaguely) know. Might have to look into it sometime. Either way, I tweaked that code to switch pallets instead of picnums and it worked without a hitch. Thanks!
This post has been edited by CruX: 15 November 2017 - 01:33 PM
#2159 Posted 24 November 2017 - 03:24 PM
This post has been edited by thisbecasper: 24 November 2017 - 03:25 PM
#2160 Posted 25 November 2017 - 03:42 AM
This post has been edited by thisbecasper: 25 November 2017 - 04:01 AM
#2161 Posted 25 November 2017 - 09:33 AM
This post has been edited by thisbecasper: 25 November 2017 - 09:40 AM
#2162 Posted 25 November 2017 - 10:09 AM
#2163 Posted 25 November 2017 - 11:35 AM
#2164 Posted 26 November 2017 - 09:06 AM
#2165 Posted 26 November 2017 - 03:09 PM
thisbecasper, on 26 November 2017 - 09:06 AM, said:
That depends on what you mean by "reset the game". There is of course the resetplayer command, which has been around since 1996.
#2166 Posted 26 November 2017 - 03:47 PM
Trooper Dan, on 26 November 2017 - 03:09 PM, said:
It have some multiplayer code that works like "search and destroy" from the CoD-series. Simply put, it's 1v1, and when one dies the other "wins" the game/round, the game should start over. Same spawns, same values on gamevars etc.
#2167 Posted 26 November 2017 - 04:59 PM
This post has been edited by Fox: 26 November 2017 - 05:00 PM
#2168 Posted 27 November 2017 - 01:37 AM
Fox, on 26 November 2017 - 04:59 PM, said:
Thanks, it's perfect - idk why I've never stumbled upon that command...

#2169 Posted 27 November 2017 - 02:52 AM
This post has been edited by thisbecasper: 27 November 2017 - 03:25 AM
#2170 Posted 27 November 2017 - 03:01 AM
Fox, on 26 November 2017 - 04:59 PM, said:
I further tested the implementation, but it acts weird... When I respawn due to the startlevel command, it kinda loads the map, but with me in it standing still - while I can move around in the new map. When the map reloads I can shoot myself if I shoot at the place I spawn, also I can jump on top of myself. I'm invisible btw...
EDIT: FIXED
This post has been edited by thisbecasper: 27 November 2017 - 03:15 AM
#2171 Posted 27 November 2017 - 04:43 AM
This post has been edited by thisbecasper: 27 November 2017 - 05:34 AM
#2172 Posted 27 November 2017 - 09:31 AM
Fox, on 26 November 2017 - 04:59 PM, said:
Startlevel freezes the games when triggered in an online game. Workaround?
#2173 Posted 27 November 2017 - 11:51 AM
#2174 Posted 27 November 2017 - 01:18 PM
thisbecasper, on 27 November 2017 - 09:31 AM, said:
Multiplayer is unfinished in Eduke32. So you are kinda of asking how to install a ceiling lamp in a house without a roof.
#2175 Posted 27 November 2017 - 01:39 PM
Mark., on 27 November 2017 - 11:51 AM, said:
I can use savemapstate and loadmapstate just fine, my only target is an auto reset level... I will look into an end of level triggering - how would you do that though?
Is there a way to use consolecommands, without typing themselves? OR maybe I could just use save and loadmapstate and afterwards tp both players to a coordinate, even though that sounds difficult.
This post has been edited by thisbecasper: 27 November 2017 - 02:29 PM
#2176 Posted 27 November 2017 - 01:41 PM
Fox, on 27 November 2017 - 01:18 PM, said:
That's true. Although I'm using the old mp build, and everything I've done so far (which is quite a lot) have been working just fine until now...
#2177 Posted 27 November 2017 - 01:51 PM
This post has been edited by Fox: 27 November 2017 - 01:51 PM
#2178 Posted 28 November 2017 - 07:51 AM
How to reset the level in multiplayer (might not work).
How to make a player respawn when a condition is met, or do something similar to setting dead_flag 0, which doesn't work anymore.
I would love to have the player, dead or alive, respawn (or whatever), in a specifik place. I can use set pos x,y,z so it's only the dead/alive thing which is the problem

This post has been edited by thisbecasper: 28 November 2017 - 07:52 AM
#2179 Posted 28 November 2017 - 08:13 AM
You may try setting player[THISACTOR].gm to 8 for all players to end the level.
#2180 Posted 28 November 2017 - 09:08 AM
Fox, on 28 November 2017 - 08:13 AM, said:
You may try setting player[THISACTOR].gm to 8 for all players to end the level.
I'm not interested in killing the player, I'm interested in setting the player alive again OR make him respawn automatically, he should not be able to respawn manually.
setplayer[THISACTOR].gm 8/32 works in singleplayer but not in multiplayer - acts the same way in call cases, just freezes with a picture of duke.
I have a countdown, and when it reaches 0 I simply call the above setter, idk why that shouldn't work, if it's possible at all. Other suggestions? heheh heh heh... :')
- Is it possible to code something into APLAYER that makes the person alive again if health is added when health < 1? The revive mechanism works when dncornholio is used, so I can't see what should prevent the revive thingy to be pulled off...
I've achieved something nice by actually adding health back to the player... my mistake.
This post has been edited by thisbecasper: 28 November 2017 - 09:24 AM
#2181 Posted 28 November 2017 - 11:47 AM
thisbecasper, on 28 November 2017 - 09:08 AM, said:
I'm not interested in killing the player, I'm interested in setting the player alive again OR make him respawn automatically, he should not be able to respawn manually.
setplayer[THISACTOR].gm 8/32 works in singleplayer but not in multiplayer - acts the same way in call cases, just freezes with a picture of duke.
I have a countdown, and when it reaches 0 I simply call the above setter, idk why that shouldn't work, if it's possible at all. Other suggestions? heheh heh heh... :')
- Is it possible to code something into APLAYER that makes the person alive again if health is added when health < 1? The revive mechanism works when dncornholio is used, so I can't see what should prevent the revive thingy to be pulled off...
I've achieved something nice by actually adding health back to the player... my mistake.
This sh*t won't work... setactor[THISACTOR].extra 10 works if theres only one player in the game, if theres two i just get kinda squished instantly, doesnt do anything. Can it really be that it is impossible to auto respawn, auto restart map or revive players?
#2182 Posted 28 November 2017 - 01:25 PM
thisbecasper, on 28 November 2017 - 11:47 AM, said:
I've been able to solve the problem now, kinda. The problem was that loadmapstate and setting players extra was done in the same tick.
#2183 Posted 28 November 2017 - 09:22 PM
onevent EVENT_DISPLAYREST ifvare BLOODTEMP 1 { setvarvar xdimminus xdim subvar xdimminus 1 setvarvar ydimminus ydim subvar ydimminus 1 rotatespritea 160 100 65536 0 BLOODSCREEN 0 0 8 BLOODTRANS 0 0 xdimminus ydimminus }

This post has been edited by spacekebab: 28 November 2017 - 09:23 PM