![]() |
#1 |
![]()
Okay, I've done some checking on the EDuke32Wiki before coming here, and from what I've seen, there's nothing mentioned about this, so I will ask:
Basically, I'm trying to make a 'money' system for kicks, it's actually an improved remake of an older system I lost a while back. Basically Duke finds money ranging from Pennies to Trillion-Dollar bills[>.>] and when he picks them up(by ducking and pressing the use button while looking at them), it is set to alter two different vars so Duke is actually grabbing money as he travels. One immediate thing this could be for is tipping the women in the game, as if Duke doesn't have the money to tip, I can code it that he won't actually do it. But this is just a small and basic example. The money system I have uses two primary vars, DOLLARS and CENTS. Basically what I really wanna do is get it that you can display the exact amount of DOLLARS and CENTS on the screen somehow(perhaps without the text fading off the screen too), whether it be through the quotes or perhaps through a different form of visual display that doesn't require having to write a quote fracture for every possible number from 1 to 1 trillion(in otherwords, it'd have to use the vars). I wanna know if it's possible as of this verstion(140 beta 2) to actually use vars in general in quotes or other graphical displays on the screen for easier use? If not, would it be asking too much to try to add future support for it? It'd probably have more uses than some of you would think. Even if it's not for quotes, but for at least a status-like display like the Kills/Secrets/Time Ratio used. Just wondering, because as I can tell, I see nothing on the Wiki mentioning of the use. Although off hand, redefinequote makes it a lot more flexible when picking up the money actors. Okay, I'm done with the post for now. |
|
![]() |
![]() |
#2 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Use digitalnumber.
|
|
![]() |
![]() |
#3 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
There's an undocumented way to display the values of gamevars in the text of a quote, but I've just changed how it works as of this writing. However, the change isn't really huge, so I guess I can explain it anyways. The command you need to use is called 'dynquote' and it takes up to 5 parameters. The first is the quote number, and the other 4 are gamevars. All you have to do is place %ld in the quote text in the places where you want the gamevars to be plugged in.
The difference between dynquote in 1.4.0 beta 2 and dynquote in all future versions is that the command previously wrote the resulting text to a temporary quote and then automatically displayed it, whereas now the result is written back to the source quote instead so that the programmer can use it with any of the other functions which use quotes. |
|
![]() |
![]() |
#4 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
Nice. I'll keep that in mind for the next time I work on menus.
__________________
DUKE PLUS New map effects and various optional extras for Duke 3D. DUKE NUKEM: ATTRITION XP based weapon upgrades, progressive difficulty, and more. |
|
![]() |
![]() |
#5 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Between your replies, I got things down as I needed to.
However, as noob as this sounds, I have a different problem. It has to do with the actual tiping, or as it might become in the future, any kind of action requiring use of deducting from money. The thing is, when I go to tip one of the women, if I hold down space even a bit too long, I end up eating away more money than I should. It's been a long while since I actively CON-coded(at least a couple years), and I forget how, but there's supposed to be a way to code it that it forces the player to wait a while before they can do something again, such as a tip in order to prevent uncontrollable money munching. Here's my current code as below. If anyone can just add in what is necessary to stop the constant munching of money, it'd be appriciated. Code:
state tipme ifp pfacing ifpdistl 1280 ifhitspace { ifvarg TRUEDOLLARS 99 { tip subvar DOLLARS 100 ifrnd 128 soundonce DUKE_TIP1 break else soundonce DUKE_TIP2 break ifactor FEM1 action FEMDANCE1 break } else { redefinequote 130 NOT ENOUGH MONEY, MAN! quote 130 } } |
|
![]() |
![]() |
#6 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
This is the method I use for things like this. It's better than making the player wait for a certain amount of time, because it allows you to spend the money as fast as you want by rapidly pressing space, but if you hold down space it will only spend it once, no matter how long it is held.
Code:
gamevar TEMP 0 2 gamevar spacepresstime 0 1 // these vars can and probably should be declared somewhere else state tipme ifp pfacing ifpdistl 1280 ifhitspace { getplayer[THISACTOR].player_par TEMP addvar spacepresstime 1 ifvarvare TEMP spacepresstime nullop else { ifvarg TRUEDOLLARS 99 { tip subvar DOLLARS 100 ifrnd 128 soundonce DUKE_TIP1 break else soundonce DUKE_TIP2 break ifactor FEM1 action FEMDANCE1 break } else { redefinequote 130 NOT ENOUGH MONEY, MAN! quote 130 } } setvarvar spacepresstime TEMP } ends // at least I assume the state ends here
__________________
DUKE PLUS New map effects and various optional extras for Duke 3D. DUKE NUKEM: ATTRITION XP based weapon upgrades, progressive difficulty, and more. |
|
![]() |
![]() |
#7 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Sorry, but when I tried that, it had no effect for me at all. In fact, I think at one point it stopped me from being able to pick up any money at all on my test map. I'll try and mess with it, but... for now, I'm still open for suggestions.
And BTW, I am looking over DNWMD for help too, but some of it is stuff I had never believed could've been done so well. Good job on it so far. |
|
![]() |
![]() |
#8 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
Hmmm, I'm not sure. The technique I gave you works fine in my own code, but I use it in keypress events. There might be something about putting it in that state that screws it up. Well, since I've gone this far....if you want to send me your cons I can fix it.
__________________
DUKE PLUS New map effects and various optional extras for Duke 3D. DUKE NUKEM: ATTRITION XP based weapon upgrades, progressive difficulty, and more. |
|
![]() |
![]() |
#9 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Alright, although this is not as connected to the old subject, I need a new question addressed:
Another thing I am sorta messing around with is an EXP/Level system. So far I got up to 25 or so levels define with their EXP ranges. That's not where the problem persists persay, but one of the things I was doing along with it was giving Duke an "Attack" stat, that is supposed to have an effect on his physical damage with his Mighty Boot. It's meant to be equal to ( (Attack * 2) + a random 1-5 damage ) The problem is that I cannot seem to figure out how to actually make this change the damage of the kick directly. I now that Deeperthought got it in DNWMD to have a variable that increases/changes the damage of all attacks, but I'm stumped to how he did it. Appearantly trying to change KNEE_WEAPON_STRENGTH with the variables I'm using isn't working. Here's the code: Code:
gamevar DUKEPHYSICALATTACK 5 1 // for the Mighty Boot Attack to determine damage. Increases with level. gamevar KNEEDAMAGE 0 1 gamevar DAMAGERANDOMIZER 0 1 onevent EVENT_FIRE { setvarvar KNEEDAMAGE DUKEPHYSICALATTACK mulvar KNEEDAMAGE 2 randvar DAMAGERANDOMIZER 5 addvarvar KNEEDAMAGE DAMAGERANDOMIZER setvarvar KNEE_WEAPON_STRENGTH KNEEDAMAGE } endevent |
|
![]() |
![]() |
#10 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
KNEE_WEAPON_STRENGTH isn't a var, it is a defined value. I'm surprised that code isn't giving you errors.
There are different ways of doing it. The way I do the player damage upgrade involves using the ht members of the sprite struct (specifically, htowner, htextra and htpicnum). Luckily for you, these all have wiki entries now.
__________________
DUKE PLUS New map effects and various optional extras for Duke 3D. DUKE NUKEM: ATTRITION XP based weapon upgrades, progressive difficulty, and more.
Last edited by DeeperThought; 09-09-2006 at 11:30 AM.
|
|
![]() |
![]() |
#11 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
One of the many tweaks of H266MOD is having the mighty foot's damage increase slightly depending on the xvel of the player. I am planning to do another thing similar to that where if you fall on top of something your zvel and the distance you fell is calculated to do damage to what ever you fell on. So if you fall from the top of a building onto a LIZTROOP, both you and the LIZTROOP would be jibbed.
Here is what you would put in place of that: Code:
setthisprojectile[THISACTOR].extra KNEEDAMAGE |
|
![]() |
![]() |
#12 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Deeper: It was giving an error. I commented out the line but I bolded it just so you know where I knew the problem was.
Both: Sadly to say, none of that helped me all too much. Part of it is that I don't have much experience with get/setactor/player and all that stuff yet, so as much as I try it, it's going over my head right now. ![]() Also, it doesn't help that setthisprojectile isn't mentioned at the Wiki at all. It doesn't error, but it's not affecting the attack at all either. I got not clue what I should set it too that's not THISACTOR. This would probably blow over quick if I had a means to contact you on an IM client or something. >.> |
|
![]() |
![]() |
#13 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
I think the problem with my strategy is that hard-coded projectiles aren't compatible with set(this)projectile, but if it were it would be so much easier.
|
|
![]() |
![]() |
#14 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Hendricks: Yeah, it sounds like it'd be much easier. I noticed you have requests out for more redefine commands on the Wiki. I'm sure if those made it in, it'd also make this easier.
Both: Although I still have not had any luck linking the damage to the kick, I do know I got a temporary var on the screen to show what damage WOULD'VE been done by the kick. I'm still struggling to find a way to link it, but my lack of knowledge of the get/setplayer/actor is limiting my use of the ht commands, so they've not been any bit helpful yet. >.> |
|
![]() |
![]() |
#15 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Quick breakdown:
<g\s>et<see list>[<sprite id>].<member> <gamevar> Get and set are pretty self-explanatory. Here is the list of things for <see list>:
Each of them has their own list of members on the wiki, except (this)projectile. Both projectile and thisprojectile use the same set of members, which are the custom projectile members like workslike and spawns. |
|
![]() |
![]() |
#16 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
well, since you mentioned of using a custom projectile with the thisprojectile functions, I went and made a "STATUSKNEE" attack that I was hoping would help me fix the problem. I set the weapon definition for WEAPON0 to shoot the STATUSKNEE attack. The attack itself works, but I still cannot for the life of me get the actual damage to change as I want it[it's by default just set to do a normal kick of damage]
Code:
define STATUSKNEE 2519 defineprojectile STATUSKNEE PROJ_WORKSLIKE 16 defineprojectile STATUSKNEE PROJ_ISOUND KICK_HIT defineprojectile STATUSKNEE PROJ_EXTRA KNEE_WEAPON_STRENGTH defineprojectile STATUSKNEE PROJ_CLIPDIST 10 defineprojectile STATUSKNEE PROJ_RANGE 896 onevent EVENT_FIRE setvarvar KNEEDAMAGE DUKEPHYSICALATTACK mulvar KNEEDAMAGE 2 randvarvar DAMAGERANDOMIZER DUKEPHYSICALATTACK divvar DAMAGERANDOMIZER 2 ifrnd 128 { addvarvar KNEEDAMAGE DAMAGERANDOMIZER } else { subvarvar KNEEDAMAGE DAMAGERANDOMIZER } // setvarvar KNEE_WEAPON_STRENGTH KNEEDAMAGE ifwasweapon STATUSKNEE { setthisprojectile[THISACTOR].extra KNEEDAMAGE } endevent |
|
![]() |
![]() |
#17 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Code:
define STATUSKNEE 2519 gamevar EGSFLAG 0 2 gamevar WEAPON0_SHOOTS STATUSKNEE GAMEVAR_FLAG_PERPLAYER defineprojectile STATUSKNEE PROJ_WORKSLIKE 16 defineprojectile STATUSKNEE PROJ_SOUND KICK_HIT defineprojectile STATUSKNEE PROJ_ISOUND KICK_HIT defineprojectile STATUSKNEE PROJ_EXTRA KNEE_WEAPON_STRENGTH defineprojectile STATUSKNEE PROJ_CLIPDIST 10 defineprojectile STATUSKNEE PROJ_RANGE 896 onevent EVENT_EGS // EVENT_EGS executes the code within only on the first tic of the actor's "life". getactor[THISACTOR].picnum EGSFLAG switch EGSFLAG case STATUSKNEE: setvarvar KNEEDAMAGE DUKEPHYSICALATTACK mulvar KNEEDAMAGE 2 randvarvar DAMAGERANDOMIZER DUKEPHYSICALATTACK divvar DAMAGERANDOMIZER 2 ifrnd 128 { addvarvar KNEEDAMAGE DAMAGERANDOMIZER } else { subvarvar KNEEDAMAGE DAMAGERANDOMIZER } ifspawnedby APLAYER { setthisprojectile[THISACTOR].extra KNEEDAMAGE } break endswitch endevent Happy Testing! ![]() ![]() ![]() |
|
![]() |
![]() |
#18 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Well, although I have no errors with the code you provided, the attack still seems to want to inflict the usual Kick damage even when the KNEEDAMAGE is well beyond it.
A while back when I first started making this, I made it that the variable for the overall damage the STATUSKNEE inflicted would be displayed on screen. I notice with your code the number will only change when the kick connects with something solid. However, it still only does the usual 10 damage, even if the damage range should be 400-600. :\ The code is still the same as you posted, nothing changed. \ Code:
// displays the actual STATUSKNEE damage var setvar digx 21 setvar digy 88 setvar tilenum 3087 setvar shade 0 setvar pal 21 setvar orientation 27 digitalnumber tilenum digx digy KNEEDAMAGE shade pal orientation ZERO ZERO xdim ydim Very sorry for the annoyances this is causing. |
|
![]() |
![]() |
#19 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
OK, this is what you have to do. First, delete\backup\comment out that EVENT_EGS code. Next, go through all the actors' code and add a state called "state status_knee_damage_control" at the very beginning of it, right after to the actor definition (i.e. "actor LIZTROOP TROOPSTRENGTH ATROOPSTAND"). Last, put this state above all actors, right up there with "action ANULLACTION 0", but after your gamevars and projectiles are defined.
Code:
gamevar picnum 0 2 state status_knee_damage_control getactor[THISACTOR].htpicnum picnum ifvare picnum STATUSKNEE { getactor[THISACTOR].htextra KNEEDAMAGE addvarvar KNEEDAMAGE DUKEPHYSICALATTACK mulvar KNEEDAMAGE 2 randvarvar DAMAGERANDOMIZER DUKEPHYSICALATTACK divvar DAMAGERANDOMIZER 2 ifrnd 128 { addvarvar KNEEDAMAGE DAMAGERANDOMIZER } else { subvarvar KNEEDAMAGE DAMAGERANDOMIZER } setactor[THISACTOR].htextra KNEEDAMAGE } ends ![]() Oh, and I enjoy helping people out. I'm not annoyed. ![]() ![]() |
|
![]() |
![]() |
#20 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Okay, I put the code in (including under actors like STAYPUTS and all), and they're finally registering the altered damage, but now I seem to have a new problem:
Once I actually hit them with the kick, they continously take damage from it until they die(unless they take damage from something else beforehand), and I want the kick to hit each enemy only once. Is there anything I can add to that state of yours to make it hit just one time on each monster? An interesting note is that this damage continously occurs to the monster even if I'm no where near them. I do know the damage variable on KNEEDAMAGE is working, because I got special boss monsters with heightened hitpoints to test it on, but even they die in seconds on a minimum strength kick because of this[if powered up, they die much faster]. :P |
|
![]() |
![]() |
#21 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
htpicnum remains set on the last weapon that the monster was hit by. It does not get cleared by the ifhitweapon function. The state keeps checking htpicnum, and seeing that it is the kick weapon, goes ahead and sets the damage again every tick. You'll notice that if you hit one of your bosses with a different weapon, the damage will immediately stop.
That's why in my code, I check to see that htextra is greater than zero before I modify the damage.
__________________
DUKE PLUS New map effects and various optional extras for Duke 3D. DUKE NUKEM: ATTRITION XP based weapon upgrades, progressive difficulty, and more. |
|
![]() |
![]() |
#22 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Yeah, I checked through your code for DNWMD and saw what you were talking about. I added it to that state, and appearantly that did the trick.
![]() I did find one oddity though at first[var related and something I had to mess around with]: the damage of the kick was double of the usual range. I set the mulvar KNEEDAMAGE to 1 instead of 2, and it did the normal damage again. I'm guessing "getactor[THISACTOR].htextra KNEEDAMAGE" is responsible for the extra damage. >.> Okay, this does bring me to the next question: appearantly the QuickKick isn't affected by this, so the obvious question is: is there a way to make the new damage affect quick kicks? Is there a picnum specfic to the QuickKick[that makes it different from the normal kick?], or am I stuck with a normal-strength quick-kick? |
|
![]() |
![]() |
#23 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
PROJ_RANGE is the number of ticks that a projectile lasts, not the distance it travels.
__________________
DUKE PLUS New map effects and various optional extras for Duke 3D. DUKE NUKEM: ATTRITION XP based weapon upgrades, progressive difficulty, and more. |
|
![]() |
![]() |
#24 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
![]() Code:
gamevar picnum 0 2 state add_knee_damage getactor[THISACTOR].htextra KNEEDAMAGE ifvarn KNEEDAMAGE 0 { addvarvar KNEEDAMAGE DUKEPHYSICALATTACK mulvar KNEEDAMAGE 2 randvarvar DAMAGERANDOMIZER DUKEPHYSICALATTACK divvar DAMAGERANDOMIZER 2 ifrnd 128 { addvarvar KNEEDAMAGE DAMAGERANDOMIZER } else { subvarvar KNEEDAMAGE DAMAGERANDOMIZER } setactor[THISACTOR].htextra KNEEDAMAGE break } ends state status_knee_damage_control getactor[THISACTOR].htpicnum picnum ifvare picnum KNEE { state add_knee_damage } break ends |
|
![]() |
![]() |
#25 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
It seems to work for both fine enough. I had to redo my other tweaks to the new code[adding Deeper's htexta code, making it that Steroids change the multiplier for some of the damage, etc], but I seem to have gotten it down.
Code:
state add_knee_damage getactor[THISACTOR].htextra tempb ifvarg tempb 0 { getactor[THISACTOR].htextra KNEEDAMAGE ifvarn KNEEDAMAGE 0 { setvarvar KNEEDAMAGE DUKEPHYSICALATTACK ifp ponsteroids { mulvar KNEEDAMAGE 5 } else { mulvar KNEEDAMAGE 2 } // Steroids make damage 2.5x stronger randvarvar DAMAGERANDOMIZER DUKEPHYSICALATTACK divvar DAMAGERANDOMIZER 2 ifp ponsteroids { mulvar DAMAGERANDOMIZER 5 } else { mulvar DAMAGERANDOMIZER 1 } // Steroids make damage 5x stronger ifrnd 128 { addvarvar KNEEDAMAGE DAMAGERANDOMIZER } else { subvarvar KNEEDAMAGE DAMAGERANDOMIZER } // Gives a Damage Error of 50% of the Physical Attack stat [+- 50% attack] setactor[THISACTOR].htextra KNEEDAMAGE break } } ends state status_knee_damage_control getactor[THISACTOR].htpicnum picnum ifvare picnum KNEE { state add_knee_damage } break ends |
|
![]() |
![]() |
#26 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
Glad you got it working (finally).
![]() |
|
![]() |
![]() |
#27 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Well, there is a new question I got. For kicks, I decided to link the SHOTSPARK1 actor to the code to see how it'd work. It does the same thing for damage, but I find that any actor shooting it also does the same damage to me[battling BOSS1s makes this big trouble if the PHYSICAL stat for the player is high]. How do you set it specfically only to work when a certain actor(APLAYER, BOSS1, PIGCOP, etc) shoots the attack? >.>
|
|
![]() |
![]() |
#28 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Here:
Code:
gamevar TEMP 0 2 gamevar TEMP2 0 2 state add_knee_damage getactor[THISACTOR].htextra tempb ifvarg tempb 0 { getactor[THISACTOR].htextra KNEEDAMAGE ifvarn KNEEDAMAGE 0 { getactor[THISACTOR].htowner TEMP getactor[TEMP].picnum TEMP2 ifvare TEMP2 APLAYER { setvarvar KNEEDAMAGE DUKEPHYSICALATTACK ifp ponsteroids { mulvar KNEEDAMAGE 5 } else { mulvar KNEEDAMAGE 2 } // Steroids make damage 2.5x stronger randvarvar DAMAGERANDOMIZER DUKEPHYSICALATTACK divvar DAMAGERANDOMIZER 2 ifp ponsteroids { mulvar DAMAGERANDOMIZER 5 } else { mulvar DAMAGERANDOMIZER 1 } // Steroids make damage 5x stronger ifrnd 128 { addvarvar KNEEDAMAGE DAMAGERANDOMIZER } else { subvarvar KNEEDAMAGE DAMAGERANDOMIZER } // Gives a Damage Error of 50% of the Physical Attack stat [+- 50% attack] setactor[THISACTOR].htextra KNEEDAMAGE break } } } ends The thing in blue is what you need to change. If you want more than one, make a new state out of the contents between the green brackets and repeat the "ifvare TEMP2 <actor> { <name of your state> }" statements.
Last edited by Hendricks266; 09-10-2006 at 07:18 PM.
|
|
![]() |
![]() |
#29 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Thanks. That worked pretty good.
My next project for the moment will probably a potential DEFENSE system. As your level goes up, resistance to attacks will rise slowly. Basically, the defense amount would be subtracted from the damage of an enemy attack until it does only 0-1 damage[1 damage because I don't want him becoming completely immune to attacks. If anyone has a good means to start me off though, it'd be nice. It's not something I'm gonna start on immediately though, unless I have incentitve to. :P |
|
![]() |
![]() |
#30 | |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
*yawn*
[Grammar Correction] Quote:
Add a reference to a state called "state player_defense" in the APLAYER actor, at the very top of its code. Code:
state player_defense getactor[THISACTOR].htextra tempb ifvarg tempb 0 { subvarvar tempb DUKEDEFENSELEVEL ifvarl tempb 1 { setvar tempb 1 } // I edited my post with DT's fix. setactor[THISACTOR].htextra tempb } ends
Last edited by Hendricks266; 09-11-2006 at 03:34 PM.
|
||
![]() |
![]() |
#31 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
ifvarl tempb 1 setvar tempb 1
__________________
DUKE PLUS New map effects and various optional extras for Duke 3D. DUKE NUKEM: ATTRITION XP based weapon upgrades, progressive difficulty, and more. |
|
![]() |
![]() |
#32 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
(bleh nevermind, I noticed my mistake, if something comes up, I'll repost >.<
![]() |
|
![]() |
![]() |
#33 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Alright, I guess I'm onto the most[in my opinion] harrowing question yet:
I know Deeperthought's DNWMD mod has it where you can upgrade the player's maximum health/armor/atomichealth and ammo by buying upgrades. However in the more traditional RPG sense of it, I hope to somehow get it set that Duke's Max Health and Stuff goes up with each level or so. Thing is, I don't know how exactly to start myself off on that. I do got case events for determining the level [if you have more/less than a certain amount of experience, the level and the KickAttack and Defense stats change to a certain amount, and I could probably put in a max health/ammo amount under each level, but I don't know I would actually get the variables to alter his maximum values. Does anyone have some code to start off with? >.>; |
|
![]() |
![]() |
#34 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
If you have a specific question about how to do something that isn't covered in the Wiki, then I'm usually happy to help. If you want a few lines of code written for you, then I'm not as enthusiastic, but sometimes I'll oblige. TX and others have helped me along the way, and I now consider it my duty to return the favor to others when I'm able.
However, it sounds to me like what you are saying is essentially this: I want a feature in my mod that is very similar to a feature in DT's mod, but I don't know how to make the minor adjustments and port it over because I don't understand the code, and I want someone to tell me how to write it.
__________________
DUKE PLUS New map effects and various optional extras for Duke 3D. DUKE NUKEM: ATTRITION XP based weapon upgrades, progressive difficulty, and more. |
|
![]() |
![]() |
#35 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Well don't worry about it then. The reason I asked you was because until I played DNWMD I didn't even think altering the maximums of things was possible. However even with looking over your code a few times, much of it has confused me when trying to use it as a base or remaking it.
The thing is I do best with learning stuff when I'm modifying existing code, I'm usually more successful with understanding from modifying the examples of others than trying brand new things completely from scratch myself and having it that I'm wanting to bang my head on something trying to figure out what I did wrong of if I'm even on the right track. I do not mean to intentionally take from your stuff. It's just you're the one person I know can actually do that stuff with the maximums(unless someone else can and hasn't revealed they can). And yes I do look through the wiki, but there are somethings that I still do not fully understand on there when I look at them(not to mention it's not all documented and some things I probably need are not yet listed). Sorry if that's the way it is, but that's how it is for me right now. :\ |
|
![]() |
![]() |
#36 | |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
Quote:
__________________
DUKE PLUS New map effects and various optional extras for Duke 3D. DUKE NUKEM: ATTRITION XP based weapon upgrades, progressive difficulty, and more. |
||
![]() |
![]() |
#37 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
On the current subject, I do believe I have gotten the hang of Maxhealth.
In fact, on top of it, I did something extra, made a state that works like Quake's Health system. In other words, if your Health goes above your normal max, it'll slowly count down to its' normal maximum if this code is used. :P Code:
gamevar PLAYERID 0 1 gamevar PLAYERHEALTH 0 1 gamevar CURRENTHITPOINTS 0 1 gamevar MAXHITPOINTS MAXPLAYERHEALTH 1 gamevar QUAKEHP 0 1 state quakestyleoverloadhp getplayer[THISACTOR].i PLAYERID getactor[PLAYERID].extra CURRENTHITPOINTS ifvarvarg CURRENTHITPOINTS MAXHITPOINTS { ifcount 30 // 30 is 1 second { setvarvar QUAKEHP CURRENTHITPOINTS subvar QUAKEHP 1 setactor[PLAYERID].extra QUAKEHP resetcount } } ends onevent EVENT_DISPLAYREST state quakestyleoverloadhp endevent |
|
![]() |
![]() |
#38 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form
That kind of thing belongs in the APLAYER actor, not in a display event. The event has DISPLAY in the name because it's used for displaying graphics on the screen. Obviously, graphics on the screen must be re-drawn once per frame, so the event itself also runs once per frame. I'm not sure why you placed the code in question in a state, but if you had placed it directly into the event you would have noticed various warnings telling you not to use things like setactor inside of such an event. You should really read a Duke 1.3D/1.5 CON faq before messing with the EDuke stuff.
Anyways, your code can be simplified to the following in the APLAYER actor: Code:
getactor[THISACTOR].extra TEMP ifvarvarg TEMP MAXHP ifcount 52 // one second is 26 counts, not 30 or 32 { addphealth -1 resetcount }
__________________
EDuke32 | Duke4.net forums, the largest Duke Nukem 3D community on the Internet Visit #eduke32 on irc.freenode.net!
Last edited by TerminX; 09-11-2006 at 12:59 PM.
|
|
![]() |
![]() |
#39 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
Whoops, guess I do have more to learn on that. Yeah, your method works just as well, if not more conveinently. Thanks. Sorry about having been such a bother. For now, I got nothing more to mention. I'm moving on to levels affecting Maxarmor[but that's the same as maxhealth, so I don't think I'll need any help now that I got maxhealth down], and maybe some other stats. I'll figure it out, or I'll come back again.
Later for now, all. ![]() |
|
![]() |
![]() |
#40 |
Re: Questions about using vars with quotes, or displaying vars on screen in text form...
A bother? I don't think I've noticed that at all. Newbies are always welcome in the community. You seem to be willing to learn, so don't feel as if you've bothered anyone.
![]() |
|
![]() |
Bookmarks |
|
|