Some questions about building mod

Talk about editing and creation of Vavoom mods

Some questions about building mod

Postby Crimson Wizard » 09 Nov 2005 20:15

Hello.
I am a novice to Vavoom and currently trying to learn how to use it. Earlier I built a small mod on JHexen and now I want to rewrite it on Vavoom C. But I meet a lot of problems here. Most irritating, ofcourse, is that some functions are not present or misplaced.
Thus, at first, i wish to ask, where is located a function, that checks for intermission message skipping? (In JHexen source it was called CheckForSkip) I've edited JHexen source so it allowed to have multipaged cluster messages. It worked so, that text was written down to the bottom of the screen, then it waited for clicking 'Fire' button, and continued to write text from the top of the screen; also I left possibility to press 'Use' button to skip whole intermission at once. To do this properly I need to change code in function that detects buttons pressing (mentioned above).
At second, I need to know if there is any variable, macro or function, that let me get screen parameters (width and height).

And also, I wonder, why there is not implemented some function for string class that could allow extracting substring? The only way to do such procedure, as I found out, it is copying string fraction char by char thru using loop.

Thanks.
Crimson Wizard
 
Posts: 881
Joined: 09 Nov 2005 14:21
Location: St. Petersburg, Russia

Postby Firebrand » 09 Nov 2005 20:43

In my short experience using Vavoom C, I found that some of the functions are hard wired with the executable, so you should try to look for them in the Vavoom source code too :), as for the screen parameters, there's a function called SetVirtualScreen, that can scale the current display to another resolution from the one being used, but you should be careful how you use it, as it can screw some things. You whould use it once, the first time you use it, everything rendered from it down will be scaled, if you use it a second time to return it to the original virtual resolution (320, 200), everything will render normally, I hope I made clear my explanation, if you have more questions just ask :wink: .
User avatar
Firebrand
 
Posts: 1000
Joined: 11 Feb 2004 08:12
Location: Mexico

Postby Janis Legzdinsh » 09 Nov 2005 21:20

CheckForSkip is located in engine (file sv_main). When a 'Fire' button is pressed, it's passed to client which sets progs variable skipintermission to true. It's then handled by intermission code (imission.vc).

Strings are on my 'to do' list. So far they haven't been implemented because strings ain't used that much.
User avatar
Janis Legzdinsh
Site Admin
 
Posts: 1952
Joined: 13 Jan 2002 08:30
Location: Limassol, Cyprus

Postby Crimson Wizard » 10 Nov 2005 11:34

I see.
Well, fortunately I managed to solve this, slightly changing my algorythm.
And I do not need string copying now, at least in this case.

About screen size. I want to put a graphic on screen during intermission (it's a menu arrow appearing to say that it is the end of page and player must press button to continue). In JHexen I used SCREENWIDTH and SCREENHEIGHT to define its location (relative to bottom-right corner). What I should use here, in Vavoom? Or, maybe, I may use constants - 320x240 - will this work at any resolution?
Crimson Wizard
 
Posts: 881
Joined: 09 Nov 2005 14:21
Location: St. Petersburg, Russia

Postby Janis Legzdinsh » 10 Nov 2005 12:49

Vavoom uses a virtual screen for drawing. The default size is 320x200.
User avatar
Janis Legzdinsh
Site Admin
 
Posts: 1952
Joined: 13 Jan 2002 08:30
Location: Limassol, Cyprus

Postby Crimson Wizard » 10 Nov 2005 13:30

When you say 'default' you mean that it can be changed by user?
(And you mentioned that you are going to change it to 640x480 in later versions)
Well, what about just any function that allow to know current virtual size?
Crimson Wizard
 
Posts: 881
Joined: 09 Nov 2005 14:21
Location: St. Petersburg, Russia

Postby Janis Legzdinsh » 10 Nov 2005 17:51

Since original progs never change it, it's always 320x200, and all drawing code assumes it to be so. You can change it with function SetVirtualScreen to change it.
User avatar
Janis Legzdinsh
Site Admin
 
Posts: 1952
Joined: 13 Jan 2002 08:30
Location: Limassol, Cyprus

Postby Crimson Wizard » 11 Nov 2005 13:13

Er, no, I do not want to change it at all. I just want to be sure that I may use these constant values to set relative grafic position.
Crimson Wizard
 
Posts: 881
Joined: 09 Nov 2005 14:21
Location: St. Petersburg, Russia

Postby Janis Legzdinsh » 11 Nov 2005 19:13

Currently you can be sure that screen size is 320x200.
User avatar
Janis Legzdinsh
Site Admin
 
Posts: 1952
Joined: 13 Jan 2002 08:30
Location: Limassol, Cyprus

Postby Crimson Wizard » 03 May 2006 11:34

Do not want to start new topic.
My new question is: how can Client classes (statusbar, clientgame etc) know whether player is human or cpu (bot)? Is there any flag or property that defines that?
Secondly, is there a deaths counter for player? (I know there's frags counter, but summirising all the times player was fragged cannot give right answer in case if player died from enviroment (ceiling crushes, falling damage etc).
Crimson Wizard
 
Posts: 881
Joined: 09 Nov 2005 14:21
Location: St. Petersburg, Russia

Postby Janis Legzdinsh » 03 May 2006 16:22

My new question is: how can Client classes (statusbar, clientgame etc) know whether player is human or cpu (bot)? Is there any flag or property that defines that?

Currently it doesn't have such information.

Secondly, is there a deaths counter for player? (I know there's frags counter, but summirising all the times player was fragged cannot give right answer in case if player died from enviroment (ceiling crushes, falling damage etc).

You can, since deaths from environment or suicides are counted as frags against player itself.
User avatar
Janis Legzdinsh
Site Admin
 
Posts: 1952
Joined: 13 Jan 2002 08:30
Location: Limassol, Cyprus

Postby Crimson Wizard » 04 May 2006 14:01

Hmm... It looks like I misundertanded how these frags counters are stored. Those in Client Game are available only between levels, don't they? At least when I check 'scores' pointer (type 'scores_t*') of ClientGame object when playing deathmatch, it has null value, so dynamic array is not allocated.
Then, where I can read current frags counters during the game? Are they available to be read from client modules? I underline that I need all the frags for all the players versus all the players.
(I am trying to make Scoreboard for Korax Arena project, that Firebrand has asked me to create)

And also. What does following message means:
level update: player overflow

well, I can GUESS what it means, but I wish to know, in what conditions can it appear?
BTW, Firebrand, if you are reading this occasionally, it's in last KA version :)

Janis Legzdinsh wrote:You can, since deaths from environment or suicides are counted as frags against player itself.

...And what about monster killing the player?
Crimson Wizard
 
Posts: 881
Joined: 09 Nov 2005 14:21
Location: St. Petersburg, Russia

Postby Firebrand » 04 May 2006 15:27

Hmm... It looks like I misundertanded how these frags counters are stored. Those in Client Game are available only between levels, don't they? At least when I check 'scores' pointer (type 'scores_t*') of ClientGame object when playing deathmatch, it has null value, so dynamic array is not allocated.
Crimson Wizard wrote:Then, where I can read current frags counters during the game? Are they available to be read from client modules? I underline that I need all the frags for all the players versus all the players.
(I am trying to make Scoreboard for Korax Arena project, that Firebrand has asked me to create)

The frag counters are also stores by the player class (check the player.vc file), I created scores for all the frags in team games too, I don't know if it's possible to pass these to the client side and use them too. AFAIK they are actually used, since the scores are printed ingame already.
Crimson Wizard wrote:And also. What does following message means:
level update: player overflow

I think this is a debug message, I tried to explain all this in the PM I sent you at the KH's forums.
Crimson Wizard wrote:I wish to know, in what conditions can it appear?
BTW, Firebrand, if you are reading this occasionally, it's in last KA version :)

Yes, I'm well aware of this ;), Janis might know better than me which conditions are needed for this :).
Crimson Wizard wrote:
Janis Legzdinsh wrote:You can, since deaths from environment or suicides are counted as frags against player itself.

...And what about monster killing the player?

You could create a deaths counter in the same way the frags actually work for the player and maybe use it in the client side too.
User avatar
Firebrand
 
Posts: 1000
Joined: 11 Feb 2004 08:12
Location: Mexico

Postby Janis Legzdinsh » 04 May 2006 16:52

Crimson Wizard wrote:Hmm... It looks like I misundertanded how these frags counters are stored. Those in Client Game are available only between levels, don't they? At least when I check 'scores' pointer (type 'scores_t*') of ClientGame object when playing deathmatch, it has null value, so dynamic array is not allocated.

Yes, scores are available only during intermission.

Then, where I can read current frags counters during the game? Are they available to be read from client modules? I underline that I need all the frags for all the players versus all the players.
(I am trying to make Scoreboard for Korax Arena project, that Firebrand has asked me to create)

You could add them to player class, like other fields for client are passed.

And also. What does following message means:
level update: player overflow

Basicly it means that network buffer is overflowing and you might see some blinking sprites.

Janis Legzdinsh wrote:You can, since deaths from environment or suicides are counted as frags against player itself.

...And what about monster killing the player?

To be clear - any death not caused by other player is counted as frag against self.

You could create a deaths counter in the same way the frags actually work for the player and maybe use it in the client side too.

Good idea.
User avatar
Janis Legzdinsh
Site Admin
 
Posts: 1952
Joined: 13 Jan 2002 08:30
Location: Limassol, Cyprus

Postby Crimson Wizard » 04 May 2006 19:05

What I want to know. Can this overflow error cause some parameters sent from Player to ClientState to be ignored? I am not absolutely sure (I shall test it probably one more time), but when I added 1 additional parameter both to Player and MainClientState and tried to use it during game, it seems that it was loosing its value every time. But when I put that new parameter at the beginning of class variable list (both Player and ClientState), all seemed to be normal.
(Then again, maybe there had been some other mistake.)
Crimson Wizard
 
Posts: 881
Joined: 09 Nov 2005 14:21
Location: St. Petersburg, Russia

Next

Return to Editing

Who is online

Users browsing this forum: No registered users and 0 guests