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

Jump to content

  • 124 Pages +
  • « First
  • 15
  • 16
  • 17
  • 18
  • 19
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   XThX2 

#481

Well I guess it indeed did work ;) Any chance of it actually being implemented anytime ?
0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#482

http://wiki.eduke32.com/wiki/Endofgame

Is that meant to trigger the episode ending video and return you to the main menu?

I just tried this in a vanilla game, and threw the line right under the APLAYER and it just mutes all sound and certain things don't work. But it doesn't play the ending video and return me to the main menu like I was hoping to. ;)

EDIT: I see that it actually works if you trigger the end of the level, so I can work with that.

This post has been edited by The Commander: 11 February 2010 - 09:12 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#483

Uh, I'm not sure what you did, but if you just put the line endofgame NUMBER in the player code, then it will constantly reset the end of game timer to that number, so the game will never end but the other effects will occur (such as ifp palive being false)
0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#484

Yeah it makes sense now, basically I want to display the ending animation (which is replaced with a new one) after the objective has been met in my mod. So I will use,
setplayer[THISACTOR].gm 8 to trigger the end of the level and endofgame to trigger that animation.

EDIT: I also noticed that it is impossible to get a lower time in the stats of 00.00.03 ;)

This post has been edited by The Commander: 11 February 2010 - 09:28 PM

0

User is offline   blue666 

#485

View PostDeeperThought, on May 19 2009, 07:28 AM, said:

No, just change the TOILETWATER actor so it gives 5 health instead of 1. You literally only have to change a 1 to a 5, that's it.

View PostA Number One, on May 19 2009, 07:41 AM, said:

Thanks. I was thinking it was probably something simple like that, but I guess I do need to crack open the duke3d.grp to get to the CON file. Which is no big deal, just takes a little more time.

Ok, Where do I change the TOILETWATER value? I take it that game.con is no longer being used? If I need to change it in duke3d.grp, I'm not real sure how to go about that. Can somebody point me in the right direction?

Thanks for any help.
0

User is offline   Danukem 

  • Duke Plus Developer

#486

If you are using Duke Plus, then open DUKEPLUS.CON with a text editor (change the extension to .txt first) and search for "ACTOR TOILETWATER". You should find this block of code:

action TOILETWATERFRAMES 0 4 1 1 1
actor TOILETWATER 0 TOILETWATERFRAMES
  ifpdistl 8192
  {
	soundonce WATER_GURGLE
	ifspawnedby TOILET
	  sizeto 34 34
	else
	{
	  ifspawnedby WATERFOUNTAINBROKE
		sizeto 6 15
	  else
		ifspawnedby TOILETWATER
		  nullop
	  else
		sizeto 24 32
	}

	ifp palive
	  ifpdistl RETRIEVEDISTANCE
		ifp pfacing
		  ifactioncount 32
			ifphealthl MAXWATERFOUNTAINHEALTH
			  ifhitspace
				ifcansee
	{
	  ifvare mtype 0
	  {
		  setvar mtype 1
		  sound REFRESHING
		  addphealth 5
	  }
	  addphealth 1
	  globalsound DUKE_DRINKING
	  resetactioncount
	}
  }
enda


Where it says "addphealth" you can change the number after it to any value you want. The first instance where it gives 5 health is for the first time you drink the water.
0

User is offline   williamjcm 

#487

I want to add a reload function in my mod (dl link in my sig) for the MP5 (replacing pistol). I looked at the code in dpcons and found a very big piece of code. Is there a simple way to make it when pressing AIM_DOWN. I know that I have to put "setvar RETURN -1" in the corresponding event.


@Commander : I downloaded your Red Alert mod and tried it. I found it quite hard : no health display and enemies can kill you in 1-2 shots.
0

User is offline   Danukem 

  • Duke Plus Developer

#488

View Postwilliamjcm, on Feb 19 2010, 04:37 AM, said:

I want to add a reload function in my mod (dl link in my sig) for the MP5 (replacing pistol). I looked at the code in dpcons and found a very big piece of code. Is there a simple way to make it when pressing AIM_DOWN. I know that I have to put "setvar RETURN -1" in the corresponding event.


Maybe it could be simpler than what I did for the MP5 in Duke Plus, but it's still going to be rather complicated. If your weapon has a true clip (not the shitty hardcoded clip system where an empty "clip" is defined as the ammo amount being divisible by the clip size), then you have to override the game's normal weapon handling to implement it. It's complicated enough that I'm not even going to try to list all the different things you have to do.
0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#489

View Postwilliamjcm, on Feb 20 2010, 01:37 AM, said:

@Commander : I downloaded your Red Alert mod and tried it. I found it quite hard : no health display and enemies can kill you in 1-2 shots.

There is a health display you must have tried playing the maps in USER MAPS or something which does not work. You have to select episode one aka ALLIES

If you find it too hard, play it on easy. The skill levels do work.
If you were trying it on easy then try it on hard to see the difference. <_<

This post has been edited by The Commander: 19 February 2010 - 10:14 AM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#490

What's the best way of making a breakable wall? I can think of using htg_t, but that would not work right for radius explosion or multiple walls...



View PostThe Commander, on Feb 19 2010, 03:07 PM, said:

There is a health display you must have tried playing the maps in USER MAPS or something which does not work. You have to select episode one aka ALLIES

If you find it too hard, play it on easy. The skill levels do work.
If you were trying it on easy then try it on hard to see the difference. <_<
For a reason I don't know, I got stuck at RA tc mission briefing screen. So I can only fo it through usermap selection...

This post has been edited by Fox: 21 February 2010 - 10:16 AM

0

User is offline   williamjcm 

#491

View PostThe Commander, on Feb 19 2010, 07:07 PM, said:

There is a health display you must have tried playing the maps in USER MAPS or something which does not work. You have to select episode one aka ALLIES

If you find it too hard, play it on easy. The skill levels do work.
If you were trying it on easy then try it on hard to see the difference. <_<


I selected the ALLIES episode and the first enemy killed me in one hit.
0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#492

View PostFox, on Feb 22 2010, 07:14 AM, said:

For a reason I don't know, I got stuck at RA tc mission briefing screen. So I can only fo it through usermap selection...

Did you press the "USE" button default "E" like it said at the bottom of the briefing screen. <_<
If so, it maybe possible that you didn't press "YES" when you first installed the mod and that .CFG pop up box came up as noted in the readme.

Although I am not sure how that would have broken the bind for the use key.

View Postwilliamjcm, on Feb 22 2010, 07:39 AM, said:

I selected the ALLIES episode and the first enemy killed me in one hit.

Do you always stand still when attacking enemies? :P
Try ducking as well to avoid fire, just keep moving.

EDIT: I seem to talk more about this mod in other threads than the one designed for it. <_<

This post has been edited by The Commander: 21 February 2010 - 07:32 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#493

Is it possible to make an actor not be affected by polymer lights?


For example, I have a lamp that will spawn an SE 49. Although the lamp itself is already bright, and it will always look different ingame because it always will glow beyond the normal sprite.
0

#494

I forgot how this is can done...so my question is how do you start in a map without weapons (pistol standard)? I thought you could do this with a tag of something...
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#495

Set the player start sector with a damaging floor. <_<

"If a damaging floor texture (except PURPLELAVA) is used under a player's inital start position, that player will start weaponless (this only works once, subsequent spawns will not be affected)." - Infosuit

This post has been edited by Fox: 08 March 2010 - 03:00 PM

0

#496

But you'll lose health then?
0

User is offline   TerminX 

  • el fundador

  #497

Start the player on a sprite platform above the floor.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #498

And/or use SE7+23.
0

User is offline   Danukem 

  • Duke Plus Developer

#499

I come up against a problem involving the map mirroring code that Plagman wrote. It chokes on a certain map, Legends2.map What happens is it gets into an infinite loop in this part of the mirroring code:

setvar I 0
whilevarvarn I NUMWALLS
{
	setvarvar A I
	getwall[I].point2 B
	setvarvar K I
	whilevarvarn A B
	{
		addvar K 1
		getwall[K].point2 B
	}


The whilevarvarn A B loop assumes that if you keep incrementing K (where K is some arbitrary wall number), then the point 2 of K will eventually loop back around and be equal to K's starting value (which is saved in A). This is true in every map I have encountered except for this one. Does that mean that the map is corrupt, or what? And how would I go about fixing the code? I can't just make it bail out because it has already swapped a lot of walls by the time it it goes infinite and the result of bailing would be a bizarre corrupted map.

EDIT: Here's what I did for now --

setvar I 0
whilevarvarn I NUMWALLS
{
	setvarvar A I
	getwall[I].point2 B
	setvarvar K I
	whilevarvarn A B
	{
		addvar K 1
		ifvarvare K NUMWALLS setvarvar B A
		else
		getwall[K].point2 B
		
	}
	ifvarvarn K NUMWALLS
	{
		setvarvar A K
		setvarvar J I
		setvarvar L K
		subvarvar L J
		divvar L 2
		addvar J 1
		whilevarn L 0
		{
			state swapwall
			setarray SWAPWALLS[J] K
			setarray SWAPWALLS[K] J
			addvar J 1
			addvar K -1
			addvar L -1
		}
	
		setvarvar J I
		whilevarvarn I A
		{
			setvarvar K I
			addvar K 1
			getwall[J].x B
			getwall[J].y C
			getwall[K].x D
			getwall[K].y E
			setwall[J].x D
			setwall[J].y E
			setwall[K].x B
			setwall[K].y C
	
			addvar I 1
		}
	}

	addvar I 1
}


If on some I, K reaches an invalid wall number, it stops the loop and does not proceed with the wall swap for that I. However, it proceeds with the next I. So far it seems to work ok.

This post has been edited by DeeperThought: 09 March 2010 - 11:07 PM

0

User is offline   Plagman 

  • Former VP of Media Operations

#500

Yeah, looks like a corrupt map. The fix sounds good from your description, I haven't look at the code.
0

User is offline   Marcos 

#501

how to make a bot follow the waypoints ?
0

User is offline   m210® 

#502

Whether it is possible to define/change zvel(vertical angle) of shotspark1 bullets?

This post has been edited by M210: 13 March 2010 - 03:09 PM

0

#503

This is gonna be a really, really stupid question <_< , but can I make an event cause a completely different one to happen? I was trying to add 4 directions of movement to my sidescroller and the camera and player angle work fine, but having 6-8 buttons control the player (4 to set the angle and at least 2 to make him walk different directions when facing the selected angle) is just overcomplicating things.

It's probably not possible so I might have to drop this idea or make some kind of "fake walk" for the player, I just thought it would be a neat gimmick. Here is a part of the code I am using;

onevent EVENT_TURNLEFT
	setvar angle 512
	setplayer[THISACTOR].ang 1024
// Somewhere here I would want it to cause the player to walk forward whilst this event was going on.
endevent

0

User is offline   XThX2 

#504

Quote

Sound (#-1) not defined!


At random times, I get this notification on console. Why would this ever happen ? (The #-1 sound definition thing)
0

User is offline   Helixhorned 

  • EDuke32 Developer

#505

View PostHigh Treason, on Mar 14 2010, 01:44 PM, said:

This is gonna be a really, really stupid question <_< , but can I make an event cause a completely different one to happen?

No, since events are just certain points in the game code where the EVENT_SOMETHING blocks get executed, and AFAIK there's no such command as "throw event".
However, couldn't you just duplicate the event code in a state and call that? There's probably some care to be taken with respect to variable bindings (per-player/per-actor), this always confuses the hell out of me <_< .
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#506

View PostDeeperThought, on Mar 10 2010, 03:40 AM, said:

I come up against a problem involving the map mirroring code that Plagman wrote. It chokes on a certain map, Legends2.map What happens is it gets into an infinite loop in this part of the mirroring code:

setvar I 0
whilevarvarn I NUMWALLS
{
	setvarvar A I
	getwall[I].point2 B
	setvarvar K I
	whilevarvarn A B
	{
		addvar K 1
		getwall[K].point2 B
	}


The whilevarvarn A B loop assumes that if you keep incrementing K (where K is some arbitrary wall number), then the point 2 of K will eventually loop back around and be equal to K's starting value (which is saved in A). This is true in every map I have encountered except for this one. Does that mean that the map is corrupt, or what? And how would I go about fixing the code? I can't just make it bail out because it has already swapped a lot of walls by the time it it goes infinite and the result of bailing would be a bizarre corrupted map.

EDIT: Here's what I did for now --

(...)


If on some I, K reaches an invalid wall number, it stops the loop and does not proceed with the wall swap for that I. However, it proceeds with the next I. So far it seems to work ok.



If I get it, all this massive code involving "point2" is to get all walls from a specific sector?

This post has been edited by Fox: 14 March 2010 - 10:11 AM

0

User is offline   m210® 

#507

Help me to make rocketjump, which will be working in multiplayer
I tried to used movesprite-command for inertia of actors, like it
	getactor[THISACTOR].htextra htextra
	ifvarg htextra 0 setvarvar k_damage htextra
	  getactor[THISACTOR].htang a
	cos x a
	sin y a
	getactor[THISACTOR].htg_t 0 b 	// actor`s count - deacceleration
	mulvar b 8						
	setvarvar tmp k_damage		 // damage
	iffloordistl 10					// deaccelerate on ground
	subvarvar tmp b
	ifvarl tmp 0 setvar tmp 0	 // clamping multiplier
	mulvarvar x tmp				// roll force = damage - deacceleration
	mulvarvar y tmp
	shiftvarr x 12
	shiftvarr y 12
	setvar z 0
	ifwasweapon RADIUSEXPLOSION  // Additional up velosity from explossion
	{
		divvar x 3
		divvar y 3
		setvar z -100
		subvarvar tmp b
		mulvarvar z tmp
	}
	movesprite THISACTOR x y z CLIPMASK0 RETURN


But it had unsynchronization and had many bugs in multiplayer. Single game works fine.

This post has been edited by M210: 22 March 2010 - 01:15 AM

0

User is offline   The Commander 

  • I used to be a Brown Fuzzy Fruit, but I've changed bro...

#508

Try to place the code in an event and call it as a state for the actors.

I had issues with trying to move actors to where I wanted them to go after they had died and reset in MP till I made it as a state in a event.
0

User is offline   Danukem 

  • Duke Plus Developer

#509

View PostThe Commander, on Mar 24 2010, 08:45 PM, said:

Try to place the code in an event and call it as a state for the actors.

I had issues with trying to move actors to where I wanted them to go after they had died and reset in MP till I made it as a state in a event.


The code should be a state or part of a state that is called by an actor when its htextra is > 0 or k_damage > 0 (I'm guessing that k_damage can be > 0 for a few tics after the actor has been hit, and there is additional code somewhere that is reducing k_damage over time)
0

User is offline   m210® 

#510

Inertia of actors code is working for single game for any actors and player, but if used that code in multiplayer for player, after a while coordinates of the player don't coincide with coordinates sprite of the player, and to hit the player, it is need to shoot at air near to player. I think this problem have a movesprite command and need to use setplayer[].posx instead movesprite. But if just to change coordinates, the player can easily appear outside of map. That is problem too.
I'll trying test it again in multiplayer. May be I'll find the problem at my code.

And second question: I tried to use htbposx to player. Why this member repeats coordinates of the player?
I think it is need for make rocket-jump
0

Share this topic:


  • 124 Pages +
  • « First
  • 15
  • 16
  • 17
  • 18
  • 19
  • 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