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

Jump to content

  • 119 Pages +
  • « First
  • 54
  • 55
  • 56
  • 57
  • 58
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

#1651

View PostFox, on 21 September 2015 - 11:55 AM, said:



Cheers Fox :) I checked all the usual haunts on Eduke wiki but they didn't list it. [Feeble excuses]I checked the pre-defined gamevars just didn't think to look in Constantly updated gamevars as simply assumed it wasn't something that'd get updated and I'd used "rendermode" as me google search[/Feeble excuses].

D'Oh!

TTFN,
Jon
0

User is offline   Daedolon 

  • Ancient Blood God

#1652

Tbh, rendmode sounds like something that would belong in Die by the Sword.
0

User is offline   NightFright 

  • The Truth is in here

#1653

I am looking for a method to display some info text at the beginning of each map.

What it's supposed to do:
- Info about the map (in my case: map name, author, creation year)
- Shown after loading of every map (i.e. when you start a new level)
- Duration: 5 secs
- Style: Ideally with the same font of status/pickup/etc messages, centered

Question is: Can it be done (I guess it can), and if so, how? ^^

This post has been edited by NightFright: 22 September 2015 - 07:56 AM

0

User is offline   Jenz/Amaka 

#1654

I got three questions I'd love to know how.
How to modify weapon stats? Like how fast it shoots, what art it loads and etc. For example, changing Devastator's firing speed to be much slower and also its rockets to make them bigger.

How can I fully copy of an enemy but with different skin? I'd like to have fully copy ALIZ for example. I got two soldiers one is male and other is female.

How do I remove intro video? Is there way to just add con code or do I just need 1 millisecond long video replacement?
0

User is offline   Daedolon 

  • Ancient Blood God

#1655

For the weapon functionality, check the weaponx variables over at Category:Pre-defined_gamevars

Then when you're ready to edit the actual stuff the weapons emit, check Defineprojectile.

For skipping the intro video, check the LOGO_FLAGS. It defaults to 255, so if you want to remove, say the LOGO_DUKENUKEM, you remove 32 from the value.

This post has been edited by Daedolon: 24 September 2015 - 10:49 AM

1

User is offline   Jenz/Amaka 

#1656

View PostDaedolon, on 24 September 2015 - 10:43 AM, said:

For skipping the intro video, check the LOGO_FLAGS. It defaults to 255, so if you want to remove, say the LOGO_DUKENUKEM, you remove 32 from the value.


So how I would type it?
gamevar LOGO_DUKENUKEM 0 0
?
Not good with CON coding.
0

User is offline   NightFright 

  • The Truth is in here

#1657

I am using this in the addon compilation as well. I disable all cutscenes with gamevar LOGO_FLAGS 2095359 0.
If you want to deactivate LOGO_DUKENUKEM which has a value of 32, you deduct that from 255 and use it like this: gamevar LOGO_FLAGS 223 0.

Following the wiki, all these bits are already set by default:
1 - LOGO_ENABLED
2 - LOGO_PLAYANIM
4 - LOGO_PLAYMUSIC
8 - LOGO_3DRSCREEN
16 - LOGO_TITLESCREEN
32 - LOGO_DUKENUKEM
64 - LOGO_THREEDEE
128 - LOGO_PLUTOPAKSPRITE

Add the values and you have 255. That's the default. If you go above that, e.g. in order to put LOGO_SHAREWARESCREENS (256), it is 256+255, so: gamevar LOGO_FLAGS 511 0. You can combine modifications, then you have to add more values. For example, if you don't want the ep.1 and ep.2 cutscenes to show, you use these:

4096 - LOGO_NOE1BONUSSCENE
8192 - LOGO_NOE2BONUSSCENE

Adding them is 12288, so 12288+255 = 12543. Result: gamevar LOGO_FLAGS 12543 0.

Bottom line is: Add conditions by adding values, remove them by subtracting values. It's a bit tricky with the "NO" entries (LOGO_NOE1BONUSSCENE, LOGO_NODUKETEAMTEXT etc) since in those cases you have to add values to remove something, but you get the hang of it quickly. Please correct me if I am wrong here.

This post has been edited by NightFright: 25 September 2015 - 12:13 AM

1

User is offline   Daedolon 

  • Ancient Blood God

#1658

For some quick profit, just set the variable to 5 0.
1

User is offline   Jenz/Amaka 

#1659

Um, I must be missing something. I tried adding...

gamevar LOGO_FLAGS 2095359 0
in GAME.CON and my own custom .CON to disable all cutscenes but nothing. They all still show up.
Then I tried
gamevar LOGO_FLAGS 223 0
to disable Duke Nukem text appearing but it still shows up.
So then..
gamevar LOGO_FLAGS 251 0
to disable menu music but that didn't work either. What did I miss?


Oh ffs. Nevermind. It's working exactly as it should. Thanks guys. I forked up.

This post has been edited by Jenz/Amaka: 26 September 2015 - 12:41 AM

0

#1660

Three kinda related questions.

Firstly I want to create an equivalent of a sector effector to perform various custom trickery. The issue will be if I implement this as a useractor then it's actor code may not run because it is sleeping (statnum = zombie). So, is there a way of making a never-sleeps useractor ?

I notice there are events 'EVENT_GAME' or 'EVENT PREGAME' which fire for each actor per game tic, but it is not clear whether these will still run for zombie actors. If there was an EVENT_TIC (which there isn't) then I guess I could use it to force my custom sprite's statnum back to 1 (awake) and I might be able to infer my hypothetical EVENT_TIC using some logic in EVENT_GAME, but this is all sounding rather wasteful of CPU cycles as well as messy.

Or .. is there another better way to implement this?

Secondly, as part of said trickery, how do I detect when a 'channel' fires (e.g. from switch, touchplate, etc) ? It would be jolly useful if there was a game event that signalled this but I can't see one. For switches I could iterate through all sprites (or a subset based on statnum) looking for appropriately tagged switches and get their state from picnum but that feels like it could add a lot of processor overhead if I did it on every game tic.

Finally it would be nice if my custom sector effector would allow me to utilise the lotag for my own purposes but currently if this is non-zero then my custom sector effector is deleted in game, presumably 'cos the lotag is being interpretted as multiplayer only or something (or is it skill level ? I forget). Whatever is there a way around this behaviour?

[Edit] Ah-ha ! Saving the lotag in a gamevar during eventloadactor and then setting lotag 0 fixes that last issue.

TTFN,
Jon

This post has been edited by The Mechanic: 26 September 2015 - 04:28 AM

0

#1661

It's me again. Is there as a way to disable the pistol casing and shotgun shell sprites ejecting without editing tiles art files? Just with pure con editing? I added casings that drop on the floor as projectiles etc. but now you have these projectiles and the old casings.

This post has been edited by December Man: 27 September 2015 - 03:24 AM

0

User is online   Hendricks266 

  • Weaponized Autism

  #1662

http://wiki.eduke32....efined_gamevars
http://wiki.eduke32....i/WEAPONx_SPAWN
0

#1663

View PostHendricks266, on 27 September 2015 - 06:46 AM, said:



Well... damn. Thanks.
0

User is offline   Jenz/Amaka 

#1664

Managed to create full copy of Lizman but I got few problems.
First is that Lizman's Copy size ingame is huge. I know that I gotta put this code, but I don't know where.
{
      sizeat 42 40
	  cstator 257
}


And also them Lizman's copies seem to attack immediately even when the player is not seen.
0

User is offline   Daedolon 

  • Ancient Blood God

#1665

Anywhere after (user)actor. Preferably at the top.
0

User is offline   Mark 

#1666

Check for lines containing "ifcansee" or "ifcanseetarget" and see if there is something there that needs tweaking. If there are no lines with those commands then you will need to add some. I don't know if you have done this or not, but I recommend looking through other people's custom con files from mods and TCs to get an idea how some things work. That helped me a lot.

This post has been edited by Mark.: 30 September 2015 - 11:07 AM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1667

View PostJenz/Amaka, on 30 September 2015 - 07:36 AM, said:

Managed to create full copy of Lizman but I got few problems.
First is that Lizman's Copy size ingame is huge. I know that I gotta put this code, but I don't know where.
{
      sizeat 42 40
	  cstator 257
}


And also them Lizman's copies seem to attack immediately even when the player is not seen.

That's because some enemies are hard-coded. In other words, part of the code is written directly in the executable.

Add this somewhere in the CON (obviously not using the LIZMAN tile):
appendevent EVENT_LOADACTOR
  switch sprite[THISACTOR].picnum
  case LIZMAN
  case LIZMANSTAYPUT
  case LIZMANSPITTING
  case LIZMANJUMP
    sizeat 40 40
    clipdist 80
    cstator 257
  break
  endswitch
endevent


Find these parts:
actor LIZMANSTAYPUT LIZSTRENGTH ai AILIZGETENEMY cactor LIZMAN enda

actor LIZMANSPITTING LIZSTRENGTH ai AILIZSPIT cactor LIZMAN enda

actor LIZMANJUMP LIZSTRENGTH ai AILIZJUMPENEMY cactor LIZMAN enda

actor LIZMAN LIZSTRENGTH

Replace with:
useractor enemy LIZMANSTAYPUT LIZSTRENGTH ai AILIZGETENEMY cactor LIZMAN enda

useractor enemy LIZMANSPITTING LIZSTRENGTH ai AILIZSPIT cactor LIZMAN enda

useractor enemy LIZMANJUMP LIZSTRENGTH ai AILIZJUMPENEMY cactor LIZMAN enda

useractor enemy LIZMAN LIZSTRENGTH


This post has been edited by Fox: 01 October 2015 - 01:36 AM

1

User is offline   Jenz/Amaka 

#1668

Aaaalmost there.

View PostFox, on 30 September 2015 - 01:02 PM, said:

That's because some enemies are hard-coded. In other words, part of the code is written directly in the executable.

Add this somewhere in the CON (obviously not using the LIZMAN tile):
appendevent EVENT_LOADACTOR
  switch sprite[THISACTOR].picnum
  case LIZMAN
  case LIZMANSTAYPUT
  case LIZMANSPITTING
  case LIZMANJUMP
    sizeat 40 40
    clipdist 80
    cstator 257
  break
  endswitch



I tried adding that code. I tried at the start of .con, end, different .con, and they all give same errors.

DS_GAME.CON: In event `EVENT_LOADACTOR':
DS_GAME.CON:33: error: parameter `ANULLACTION' is undefined.
DS_GAME.CON:33: error: expected a keyword but found `0'.
Found 0 warning(s), 2 error(s).

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1669

Sorry, I missed the endevent. :/
1

User is offline   Daedolon 

  • Ancient Blood God

#1670

You've removed this from GAME.CON

action ANULLACTION 0


nvm

This post has been edited by Daedolon: 01 October 2015 - 01:37 AM

0

User is offline   Jenz/Amaka 

#1671

View PostFox, on 01 October 2015 - 01:36 AM, said:

Sorry, I missed the endevent. :/

That did it! Many thanks, Fox! :)
0

#1672

I'm intending to respawn enimies from within a CON script (and the standard RESPAWN sprite 'aint gonna cut it). Whilst I can spawn stuff easilly, how do I update the total enemy count ? If the player hasn't killed a monster I have, or intended to have, spawned then it needs to be added to the number of missed kills.

Also, if I may, a repeat of previous question - how do I detect an activator firing from within CON code ? Possible ? Not possible ?

TTFN,
Jon
0

User is online   Danukem 

  • Duke Plus Developer

#1673

View PostThe Mechanic, on 02 October 2015 - 11:22 AM, said:

I'm intending to respawn enimies from within a CON script (and the standard RESPAWN sprite 'aint gonna cut it). Whilst I can spawn stuff easilly, how do I update the total enemy count ? If the player hasn't killed a monster I have, or intended to have, spawned then it needs to be added to the number of missed kills.


I'm not entirely sure what you are asking, but you might be saying that when you spawn an enemy, the max number of kills in the map does not get increased. If that's the case, then you can fix that by reading/writing the following:

http://wiki.eduke32....x_actors_killed

View PostThe Mechanic, on 02 October 2015 - 11:22 AM, said:

Also, if I may, a repeat of previous question - how do I detect an activator firing from within CON code ? Possible ? Not possible ?


You can try this command:

http://wiki.eduke32....activatormotion

IIRC it only works in certain contexts. I ended up making my own special activators by looping through sprites and changing, checking per-actor gamevars.
1

#1674

View PostTrooper Dan, on 02 October 2015 - 01:22 PM, said:

I'm not entirely sure what you are asking, but you might be saying that when you spawn an enemy, the max number of kills in the map does not get increased. If that's the case, then you can fix that by reading/writing the following:

http://wiki.eduke32....x_actors_killed


D'oh ! :) Yes, that is what I need, I thought I'd searched the wiki thoroughly, it just didn't click that it'd be a per-player thing which, of course, now seems obvious. Cheers ! Yes, I want (in theory at least) to be able to have infinite respawns, I think it may be of encouraging players not to revisit an area too often which they can take as a hint they are going the wrong way. After all, if Duke has cleared an area, why wouldn't the aliens send in re-inforcements?

Anyhow, when I detect a player triggering one of my respawns alls I'll know is the player's THISACTOR value. How would I convert this to the relevent index into the player structures ? Or is the script system smart enough such that getplayer[THISACTOR] will re-interpret THISACTOR for me ? Or should I just ignore multiplayer and use getplayer[0] ? (I don't play multiplayer and I'm sure I read somewhere that current Eduke versions aren't multiplayer anyway?).

View PostTrooper Dan, on 02 October 2015 - 01:22 PM, said:

You can try this command:

http://wiki.eduke32....activatormotion

IIRC it only works in certain contexts. I ended up making my own special activators by looping through sprites and changing, checking per-actor gamevars.


I couldn't see how to use checkactivatormotion. At the moment I've implemented what you have done, my own activator system and grouping sprites as a chains of groups of sprites (debugging a linked list of linked lists in a primitive script language and no debugging tools nearly did for what little is left of my sanity!). Unfortunately it does mean I need helper sectors (e.g. a door) to translate a standard activator to jonz system, which is a nuiscence.

Can you provide any further info on the contexts in which Checkactivatormotion works ?

Currently my main game loop looks like this:
gamevar ticky 0 0
gamevar startupdebug 1 0

// Called once per "tic" _per_ _actor_. Not clear if this gets called for actors that the
//   game has decided are temporarily zombied ? Jonz sprites are not useractors so maybe
//   will never be zombied ??
onevent EVENT_GAME

	ifvarn startupdebug 0
	{
		... dump some debug stuff
		setvar startupdebug 0
	}
	
	// Fudge: There is no event that runs once per tick so we need to infer one.
	// Ticks are roughly in milliseconds. This is NOT accurate for multiplayer
	//   and game should never sync to this for multiplayer. TODO: Use what else?
	getticks temp1
	setvarvar temp2 temp1
	
	subvarvar temp2 ticky
	
	ifvarg temp2 33	// Roughly 30 times per second. Ish. 
	{
		setvarvar ticky temp1
		
		// Process jonz main sprite system
		//   This is more efficient this way otherwise I'd be searching chains of
		//   groups of sprites for every actor on every tick. What I need is an EVENT_GAME
		//    that runs once per game tic but there isn't one ?
		state process_allsectormonitors
		
		state update_sectorchangers

                //state move_sprite_groups   TODO
		
		// TODO : revise this if how sounds are played is influenced by THISACTOR
		state update_jsounds
	}
	
	// These effects may spawn objects so will only work if THISACTOR is correctly set.
	state update_alljeffects
	
	state update_alljrespawns

endevent


It has happened this way because I'm not confident about when, or what happens, should my sprites get marked by Eduke as zombied because the player hasn't seen them in a while (however they are _not_ useractors). Also unless I've missed something there is no event that fires once per game tick - plus I dont know the interval of a game tick.

TTFN,
Jon
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1675

Dude, what a mess. o_O

View PostThe Mechanic, on 02 October 2015 - 11:40 PM, said:

D'oh ! :) Yes, that is what I need, I thought I'd searched the wiki thoroughly, it just didn't click that it'd be a per-player thing which, of course, now seems obvious. Cheers ! Yes, I want (in theory at least) to be able to have infinite respawns, I think it may be of encouraging players not to revisit an area too often which they can take as a hint they are going the wrong way. After all, if Duke has cleared an area, why wouldn't the aliens send in re-inforcements?

If you want RESPAWNs to continue working after being activated, use this:

appendevent EVENT_KILLIT
  ifactor RESPAWN
  {
    setvar RETURN -1
    setactor[THISACTOR].extra 0
  }
endevent


View PostThe Mechanic, on 02 October 2015 - 11:40 PM, said:

Anyhow, when I detect a player triggering one of my respawns alls I'll know is the player's THISACTOR value. How would I convert this to the relevent index into the player structures ? Or is the script system smart enough such that getplayer[THISACTOR] will re-interpret THISACTOR for me ? Or should I just ignore multiplayer and use getplayer[0] ? (I don't play multiplayer and I'm sure I read somewhere that current Eduke versions aren't multiplayer anyway?).

Yes, it will re-interpret THISACTOR. If you use it for getactor, THISACTOR returns the current actor ID, for getplayer it will be the nearest player ID, and for getsector it will be the current actor sector ID.

It's tricky, but in multiplayer you would have to change the value of max_actors_killed for all players...

View PostThe Mechanic, on 02 October 2015 - 11:40 PM, said:

Currently my main game loop looks like this:
[...]

It has happened this way because I'm not confident about when, or what happens, should my sprites get marked by Eduke as zombied because the player hasn't seen them in a while (however they are _not_ useractors). Also unless I've missed something there is no event that fires once per game tick - plus I dont know the interval of a game tick.

TTFN,
Jon

Not sure where you are getting with this. First of all, EVENT_GAME runs every tic for all existing sprites in the map, including sleeping (zombie) actors. So a global gamevar would be overwritten.

If you want to prevent an actor from ever sleeping, I believe this would work:
onevent EVENT_GAME
  ifactor MYACTOR
    setactor[THISACTOR].httimetosleep 0
endevent


This post has been edited by Fox: 03 October 2015 - 12:22 AM

1

#1676

View PostFox, on 03 October 2015 - 12:22 AM, said:

Dude, what a mess. o_O


I did enquire about how to achieve what I'm trying to do in previous threads when I was at the planning stage, this so far has been the only way I've been able to move forward.

I have sprites grouped into functional groups as sprites within a group interact with each other, with one sprite within that group acting as a master. When I wrote that piece of code you need to bear in mind that I couldn't get an answer on whether EVENT_GAME would still get called for sleeping sprites so this was the only way I could see to absolutely gaurentee my sprites would get processed. A gaurentee that EVENT_GAME is _always_ called for every sprite will certainly make my life easier.

View PostFox, on 03 October 2015 - 12:22 AM, said:

If you want RESPAWNs to continue working after being activated, use this:

appendevent EVENT_KILLIT
  ifactor RESPAWN
  {
    setvar RETURN -1
    setactor[THISACTOR].extra 0
  }
endevent




If a RESPAWN has never respawned during a game then that should be counted as one enemy the player failed to kill. After the first respawn, it does _not_ count as a missed enemy unless it has actually spawned another enemy. I doubt that logic is built into the game.

Hello, what is the actor's 'extra' doing that requires it to be set to 0 ?

View PostFox, on 03 October 2015 - 12:22 AM, said:

Yes, it will re-interpret THISACTOR. If you use it for getactor, THISACTOR returns the current actor ID, for getplayer it will be the nearest player ID, and for getsector it will be the current actor sector ID.


Just to clarify, are you saying that:
getactor[THISACTOR].sectnum temp
getsector[temp].somethingorother ....


can actually be done with
getsector[THISACTOR].somethingorother ...


That'd be useful.

View PostFox, on 03 October 2015 - 12:22 AM, said:

It's tricky, but in multiplayer you would have to change the value of max_actors_killed for all players...


Indeed, I'm hoping that using extspritestat and specifying STAT_PLAYER will iterate through each player, though I'm not sure if the sprite values returned by that function will be valid in accessing the player-specifc sprite vars. Gonna just have to suck it and see.

View PostFox, on 03 October 2015 - 12:22 AM, said:

Not sure where you are getting with this. First of all, EVENT_GAME runs every tic for all existing sprites in the map, including sleeping (zombie) actors. So a global gamevar would be overwritten.

This was the vital answer that I hadn't been able to find stated explicitly. When I sketched out the game loop I posted I did not have that as a gaurentee, hence implementing things the way I did.

View PostFox, on 03 October 2015 - 12:22 AM, said:

If you want to prevent an actor from ever sleeping, I believe this would work:
onevent EVENT_GAME
  ifactor MYACTOR
    setactor[THISACTOR].httimetosleep 0
endevent



Ah, I'd been using this wiki page which didn't mention httimetosleep. After a search, it is listed in this page which shows even more interesting looking stuff. What's going on ? Is the first page a general sprite structure, and the second page adds gamevars that are also applicable to sprites defined as (user)actors? i.e. setactor[THISACTOR].httimetosleep will work for a (user)actor but blow up if I tried to use it on a regular every day decorative sprite ?

TTFN,
Jon

PS: I want 'ifsoundvar' but it doesn't exist. Is there an alternative ? Currently I've a 450 line monster func to attempt this functionality - yeuk! - IIRC, the first time I've used a spreadsheet to generate code !
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1677

View PostThe Mechanic, on 03 October 2015 - 01:47 AM, said:

If a RESPAWN has never respawned during a game then that should be counted as one enemy the player failed to kill. After the first respawn, it does _not_ count as a missed enemy unless it has actually spawned another enemy. I doubt that logic is built into the game.

I had written a code for that some time ago, as far I remember the results were very precise. I may take a look at it again...

View PostThe Mechanic, on 03 October 2015 - 01:47 AM, said:

Hello, what is the actor's 'extra' doing that requires it to be set to 0 ?

It's used by the game to make RESPAWNs work. Not my fault.

View PostThe Mechanic, on 03 October 2015 - 01:47 AM, said:

Just to clarify, are you saying that:
getactor[THISACTOR].sectnum temp
getsector[temp].somethingorother ....


can actually be done with
getsector[THISACTOR].somethingorother ...


That'd be useful.

Correct.

View PostThe Mechanic, on 03 October 2015 - 01:47 AM, said:

Indeed, I'm hoping that using extspritestat and specifying STAT_PLAYER will iterate through each player, though I'm not sure if the sprite values returned by that function will be valid in accessing the player-specifc sprite vars. Gonna just have to suck it and see.

In this case, you wouldn't loop through the player actors, but the player IDs.

  setvar temp 0
  whilevarvarn temp MULTIMODE
  {
    getplayer[temp].max_actors_killed temp2
    addvar temp2 1
    setplayer[temp].max_actors_killed temp2
    addvar temp 1
  }


View PostThe Mechanic, on 03 October 2015 - 01:47 AM, said:

This was the vital answer that I hadn't been able to find stated explicitly. When I sketched out the game loop I posted I did not have that as a gaurentee, hence implementing things the way I did.

Being even more explicit, note that I said sprites, not actors, because EVENT_GAME also run through decorative sprites or projectiles.

View PostThe Mechanic, on 03 October 2015 - 01:47 AM, said:

Ah, I'd been using this wiki page which didn't mention httimetosleep. After a search, it is listed in this page which shows even more interesting looking stuff. What's going on ? Is the first page a general sprite structure, and the second page adds gamevars that are also applicable to sprites defined as (user)actors? i.e. setactor[THISACTOR].httimetosleep will work for a (user)actor but blow up if I tried to use it on a regular every day decorative sprite ?

These pages are redundant. In a website running on a wiki software you define categories for pages, which serve merely for an organizational purpose. However EDukeWiki has its own page for structures, which are preferable.

These structures exist for all sorts of sprites.

View PostThe Mechanic, on 03 October 2015 - 01:47 AM, said:

PS: I want 'ifsoundvar' but it doesn't exist. Is there an alternative ? Currently I've a 450 line monster func to attempt this functionality - yeuk! - IIRC, the first time I've used a spreadsheet to generate code !

Indeed, that command doesn't appear to exist. Don't forget ifsound is unsynchronized, so be careful!

This post has been edited by Fox: 03 October 2015 - 02:14 AM

0

User is offline   Jblade 

#1678

ifsound should just accept a variable itself, have you tried it?
1

#1679

View PostFox, on 03 October 2015 - 02:14 AM, said:

  setvar temp 0
  whilevarvarn temp MULTIMODE
  {
    getplayer[temp].max_actors_killed temp2
    addvar temp2 1
    setplayer[temp].max_actors_killed temp2
    addvar temp 1
  }



Ah-ha, so the mysterious MULTIMODE is in fact the number of players. (Does a bit more delving) should that be numplayers as that doesn't include bot players? (for the original purposes of kill count I doubt it makes any difference, but I'm thinking more generally).

View PostFox, on 03 October 2015 - 02:14 AM, said:

Don't forget ifsound is unsynchronized, so be careful!


Do you mean unsynchronised between multiple players ? Or something worse ?

The reason I'm using my "ifsoundvar" is only to enable playing one sound effect after another finishes (I've given up doing this with door sectors as duke's door-generated sounds are bloody unpredictable at best), or loop a sound (save building elevator help sectors - that really was a neat trick). I'm not using the end of a sound to do anything more than that so should I get away with it ?

If my object spawns a sound - 71, say - and whilst that is playing some other game event also starts a sound 71 then yes my object will be waiting for the second one to finish, but that is a minor limitation of my system. In practice the sounds spawned by my object are likely to not crop up at the same time elsewhere.

View PostJblade, on 03 October 2015 - 02:50 AM, said:

ifsound should just accept a variable itself, have you tried it?


By accident yes. (Indeed, 75% of errors I make are 'cos I forget the additioanl 'var' on the end of funcs).

There is 'sound' for playing a fixed sound, 'soundvar' for sounds based on a variable, 'ifsound' to check for a fixed sound and .... (drum roll) ... no fricken 'ifsoundvar' :)

TTFN,
Jon

This post has been edited by The Mechanic: 03 October 2015 - 05:03 AM

0

User is offline   Mark 

#1680

How about just creating your own custom sounds instead of complicated code or Build tricks to play one sound after another, etc...

This post has been edited by Mark.: 03 October 2015 - 05:57 AM

0

Share this topic:


  • 119 Pages +
  • « First
  • 54
  • 55
  • 56
  • 57
  • 58
  • 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