Random Monitor's states?

Status
Not open for further replies.

742mph

My work is never done yet
For some reason, there is no A_RandomStateRange action used in the RandomMonitor's states, according to SOCEdit, at least. How does it randomize things, then? Is it built into the source code? If not, can it be modified to include different things in the randomizing process than under ordinary circumstances? For example, if I wanted to have it include a custom monitor in the random selection, how would I do that?
 
That's unforunate. Do you know how it works? For example, does it choose from a set of hardcoded states, or does it randomize the DeathStates of all objects with MF_MONITOR, or something else like that?
 
It chooses the random powerup by selecting from a hardcoded set of objects, and spawning the monitor icon determined in the chosen objects' "Damage" value, which in turn set the power-up given to the player. This is done using A_MonitorPop, which is hardcoded to do this only with the Random monitor specifically.
 
Last edited:
Ah, I see. Is it possible for A_MonitorPop to be used by the Random Monitor without producing the randomizing effect, or is the effect unavoidable?
 
Um, no, I don't think you can stop the Random Monitor doing the randomizing effect when using A_MonitorPop, AFAIK.
 
Ah, well. I guess I'll just try to find some way around it with SOCs...

EDIT: Just one last question. Are the Random Monitor's effects tied to its Object number, or its Thing number on the map?
 
Last edited:
Well, that's fortunate. Also, one thing: how do I change the upper and lower bits of a variable independently? I want to SOC an object with the same map thing number as the Random Monitor to drop a random other monitor within a selection upon spawning with A_SpawnObjectRelative, but it requires the two sets to be manipulate individually.
 
Also, one thing: how do I change the upper and lower bits of a variable independently?
I'm not sure what you mean by "changing independently". If you need to change one and leave the other as it is, just recalculate the value.

Code:
Var = [Upper bits value]*65536 + [Lower bits value]

So if your current value is 131079 (2*65536 + 7) and you want to change your upper bits value from 2 to 3, just add 65536 and you'll get 196608. It's elementary algebra, just with huge numbers. It will be easier beginning with 2.1, where you can just type "2*65536 + 7" into the variable field and the game calculates the final value itself.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top