Duke4.net Forums: EDuke32 Scripting - Duke4.net Forums

Jump to content

  • 124 Pages +
  • « First
  • 71
  • 72
  • 73
  • 74
  • 75
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   spacekebab 

#2154

The only way I could get CHAIR1 to spawn scrap when hit was to make a new BROKENCHAIR2 actor and point to it via cactor. or change the source code directly in sector.cpp. Is the actor hardcoded or am I just missing something?

This post has been edited by spacekebab: 07 November 2017 - 09:51 AM

0

User is online   Danukem 

  • Duke Plus Developer

#2155

 spacekebab, on 07 November 2017 - 09:51 AM, said:

The only way I could get CHAIR1 to spawn scrap when hit was to make a new BROKENCHAIR2 actor and point to it via cactor. or change the source code directly in sector.cpp. Is the actor hardcoded or am I just missing something?


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.
0

User is offline   CruX 

#2156

is there any way to mass-change the properties of a specific texture used in a map (through con coding) based on the properties it already has? Sector/wall structs really aren't my strong suit so I don't know how complicated this is, but it's stumped me either way. Basically I'm trying to assign a hightile to #199 because it's used as a sky texture a lot.

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

0

User is online   Danukem 

  • Duke Plus Developer

#2157

 CruX, on 15 November 2017 - 12:00 PM, said:

is there any way to mass-change the properties of a specific texture used in a map (through con coding) based on the properties it already has? Sector/wall structs really aren't my strong suit so I don't know how complicated this is, but it's stumped me either way. Basically I'm trying to assign a hightile to #199 because it's used as a sky texture a lot.

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.
1

User is offline   CruX 

#2158

 Trooper Dan, on 15 November 2017 - 01:05 PM, said:

Wouldn't it make more sense to use mapster script and just fix the map?


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

0

#2159

Hey guys. I want to achieve something special this time. I want to simulate arming a bomb. So let's say we have a raised sector on a map that looks like a box. I want to have a countdown start when ive been near the bomb and held a key for 2,5 seconds. If the key-press-thingy doesn't work I want something similar to be done in order to get the countdown started (simulating the bomb has been armed). I've thought about using an item on the ground to be a trigger for the countdown, but that doesn't work in my head, because I want to be able to cancel the arming process in the middle of the 2,5 seconds, and if I do that, a new item would have to be placed on the ground and stuff like that. Maybe I could code a sector to have a specifik lotag that trigs some code or something. I honestly don't care about the implementation as long as the arming process works as intended. I should note that it's for multiplayer purposes :-) THANKS IN ADVANCE

This post has been edited by thisbecasper: 24 November 2017 - 03:25 PM

0

#2160

Deleted.

This post has been edited by thisbecasper: 25 November 2017 - 04:01 AM

0

#2161

I have a counter decrementing when a condition is met. However, if I set the counter to be a gamevar with a flag 0 instead of 1 or 2, it decrements exactly twice as fast, how come?????

This post has been edited by thisbecasper: 25 November 2017 - 09:40 AM

0

User is offline   Daedolon 

  • Ancient Blood God

#2162

0 is a global value, so without seeing the code, sounds like you have two things changing the value.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#2163

It's hard to tell without seeing the code. It may be incidental, something unrelated, etc.
0

#2164

I've got it to work now - another thing: Is there a way to reset the game automatically when a condition is met?
0

User is online   Danukem 

  • Duke Plus Developer

#2165

 thisbecasper, on 26 November 2017 - 09:06 AM, said:

I've got it to work now - another thing: Is there a way to reset the game automatically when a condition is met?


That depends on what you mean by "reset the game". There is of course the resetplayer command, which has been around since 1996.
0

#2166

View PostTrooper Dan, on 26 November 2017 - 03:09 PM, said:

That depends on what you mean by "reset the game". There is of course the resetplayer command, which has been around since 1996.

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.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#2167

Use "startlevel VOLUME LEVEL".

This post has been edited by Fox: 26 November 2017 - 05:00 PM

2

#2168

View PostFox, on 26 November 2017 - 04:59 PM, said:

Use "startlevel VOLUME LEVEL".

Thanks, it's perfect - idk why I've never stumbled upon that command... :D
0

#2169

How come, even though runspeed is set to 0, you are able to move slowly and oddly, if you crouch and try to move? How can I prohibit all movement in the plane? Also, if you setvar RETURN -1 onevent crouch, youd still be able to move slowly and weird when trying to move while crouching, when movespeed is set to 0

This post has been edited by thisbecasper: 27 November 2017 - 03:25 AM

0

#2170

View PostFox, on 26 November 2017 - 04:59 PM, said:

Use "startlevel VOLUME LEVEL".

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

0

#2171

Do any of you know how to disable the drawing of the name of the map you enter in the beginning of a level? And is there a way to enable/disable coopview?

This post has been edited by thisbecasper: 27 November 2017 - 05:34 AM

0

#2172

View PostFox, on 26 November 2017 - 04:59 PM, said:

Use "startlevel VOLUME LEVEL".

Startlevel freezes the games when triggered in an online game. Workaround?
0

User is offline   Mark 

#2173

How about triggering "end of level" first. Or does that act screwy in MP mode? Or mess up the restart with your vars set right?
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#2174

View Postthisbecasper, on 27 November 2017 - 09:31 AM, said:

Startlevel freezes the games when triggered in an online game. Workaround?

Multiplayer is unfinished in Eduke32. So you are kinda of asking how to install a ceiling lamp in a house without a roof.
0

#2175

View PostMark., on 27 November 2017 - 11:51 AM, said:

How about triggering "end of level" first. Or does that act screwy in MP mode? Or mess up the restart with your vars set right?

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

0

#2176

View PostFox, on 27 November 2017 - 01:18 PM, said:

Multiplayer is unfinished in Eduke32. So you are kinda of asking how to install a ceiling lamp in a house without a roof.

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...
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#2177

If I recall, startlevel didn't worked in multiplayer in older versions either.

This post has been edited by Fox: 27 November 2017 - 01:51 PM

0

#2178

It would be a great help if someone could say if there's a fix or not to these problems:
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 :D

This post has been edited by thisbecasper: 28 November 2017 - 07:52 AM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#2179

Can you not kill the player by setting the health to zero?

You may try setting player[THISACTOR].gm to 8 for all players to end the level.
0

#2180

View PostFox, on 28 November 2017 - 08:13 AM, said:

Can you not kill the player by setting the health to zero?

You may try setting player[THISACTOR].gm to 8 for all players to end the level.

I dont know if you've misunderstood me or vice versa...
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

0

#2181

View Postthisbecasper, on 28 November 2017 - 09:08 AM, said:

I dont know if you've misunderstood me or vice versa...
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?
0

#2182

View Postthisbecasper, on 28 November 2017 - 11:47 AM, said:

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?

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.
0

User is offline   spacekebab 

#2183

What would be the best way to get blood splatter on screen? I can't, for the life of me, get it to "stop" correctly or start again if I do - don't really know how to use 'rotatesprite' or if it's my only option. Thanks for any ideas!


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
}



Posted Image

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

1

Share this topic:


  • 124 Pages +
  • « First
  • 71
  • 72
  • 73
  • 74
  • 75
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options