Side scroller movement with ACS

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Well, the Abuse-style aiming was something I had in mind for it but it does sound a bit difficult to translate the 2-d mouse coordinates into an aiming angle in 3-d. I'm not even sure how I'm going to do that.

As for the other stuff you mentioned, well to be honest it's kind of confusing the way you wrote it. :) But the crouching does work nicely as it does in first person view.

Now that is all for the old version where I manipulated the player directly.

I've updated the WAD above with a new, cleaner version. I have two problems with it now:

1) Choppy left/right movement
2) Jumping doesn't really work the way I though it would

Help please! :(
User avatar
Ultraviolet
Posts: 1152
Joined: Tue Jul 15, 2003 9:08 pm
Location: PROJECT DETAILS CLASSIFIED.

Post by Ultraviolet »

Just use the standard player controls mapped to different keys, yeesh.

Any points in my post you'd care to specify that you had trouble understanding? I can rephrase.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

As far as the ideas you suggested go, they are all pretty much what I had in mind anyway...
User avatar
Ultraviolet
Posts: 1152
Joined: Tue Jul 15, 2003 9:08 pm
Location: PROJECT DETAILS CLASSIFIED.

Post by Ultraviolet »

Then this should be fun!
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

I have scrapped the WAD I posted on the first page, and have decided to go the "custom KEYCONF" route.

But now I have another major problem.

I'm trying to do custom jumping animations for the Doom player. At first I thought it was easy, I thought I could use GetActorFloorZ. But it won't work for 3-d floors or K2bridge platforms.

So I tried to find a hack around it. Spawn a falling projectile beneath the player constantly. If it hits the floor, it means the player is on the floor. If it doesn't, it'll just disappear (the Spawn state has a "stop" instruction at the end so its life is very short), and it means the player is in the air.

I can't get it to work. Basically, the array player_isonfloor is supposed to keep track of the floor Z status for each player. But no matter what I do, it's just not working.

I really need help with this because I'm stumped already. I can't really explain what I'm doing with words alone so I'll just post the entire files here. I really hope I can get help on this because I don't see what I'm doing wrong.

http://nash.wanzafran.com/doomstuff/sdoomadv.zip

Easy instructions: extract everything into a new folder, copy doom2.wad into it and double-click play.bat.

Or if you aren't going to use play.bat or my included INI - please bind the necessary keys for this mod under the "Super Doom Adventure" key section. Otherwise you can't really do anything.

Oh and you'll probably still need to use the EXE I included in that ZIP because I may have used some features that aren't in ZDoom 2.1.7.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

I would recommend going back to using KEYCONF instead of using a hacky solution which requires capturing player movement. The main reason is that with KEYCONF you directly call scripts which control the player interaction, whereas if you trap the player and monitor their movements, you're introducing Doom's movement code into the equation which makes things significantly more complex and (as you're discovering) prone to failure.

As for ease of setup, you have a couple options. The first is simple: Provide a KEYCONF and instructions letting the player know they need to set up their binds the first time they play. You could alternately provide a custom INI and a batch file to use it, and the INI could set the binds to the defaults (cursor keys or whatnot).
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Hey Steve, could you possibly have a look at my new file (the one above your post) and check out why isn't my Floor Z checker working like it should? :D
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

I can't right now as I'm at work, however I'll try to remember to take a peek at it when I get home. Offhand, though, I'd have to guess that the projectile is either not spawning at all (because both it and the player are solid) or is immediatly impacting the player and exploding on spawn.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

The projectile is spawning as expected, as I see the medikit (which represents the projectile's spawn state) and the health bonus (representing the death state).

To confirm that it actually works, I tried replacing my calls to ACS_ExecuteAlways from the spawn and death states with A_Prints. Surely enough, the screen printed "OFF" when I was jumping, and "ON" while I'm on the floor.

But the minute I replace the A_Prints with ACS_ExecuteAlways, it just... doesn't work. What is supposed to happen here is that it'll execute a script that assigns a value to the array player_isonfloor[]. This array keeps track of the all players' floor Z status.

I know it's not working because I have another script monitor this array and prints in on the screen. All it ever shows is a 0. :(

Anyway, this won't make sense right now until after you've seen the file. Consider this as notes for you. :)
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Can you post the relevant parts of the script that set and check the variable here? I'm terribly bored and this would give me something to do. ^_^
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Alright, I hope this has enough information for you to work on...

The main loop, with everything that's irrelevant removed:

Code: Select all

script SCRIPT_MAIN_LOOP (VOID) NET // main game loop
	{

	// MAIN LOOP

	while(1)
		{
		... lots of stuff removed
		
		// spawn FloorZ checker
		if (floorz_spawn_delay <= 0)
			{
			SpawnProjectile(ActivatorTID(), "SuperDoomAdventure_FloorZChecker", GetActorAngle(0) >> 8, 0, -4, 1, FLOORZ_CHECKER_TID + PlayerNumber());
			floorz_spawn_delay = 5;
			}
		
		// counters
		floorz_spawn_delay--;
		
		Delay(1);
		}
	}
The script that is supposed to get called from the projectiles' states to set the array:

Code: Select all

script SCRIPT_FLOORZ_CHECKER (int floorz_state) NET // FloorZ checker
	{

	Switch(floorz_state)
		{
		Case 0:
			player_isonfloor[ActivatorTID() - MAX_PLAYERS] = 0;
			Print(s: "Off");
			Break;
		Case 1:
			player_isonfloor[ActivatorTID() - MAX_PLAYERS] = 1;
			Print(s: "On");
			Break;
		}

	}
The DECORATE:

Code: Select all

actor SuperDoomAdventure_FloorZChecker
	// ignore the totally random sprites, this actor is really supposed to be invisible
	// it'll execute script 7, which will set values for the player_isonfloor[] array
	{
	radius 4
	height 8
	speed 10
	damage 0
	PROJECTILE
	states
		{
		Spawn:
			MEDI A 0
			MEDI A 0 ACS_ExecuteAlways(7, 0, 0) // player is not on the floor
			MEDI A 4
			stop
		Death:
			TNT1 A 0
			BON1 A 4 ACS_ExecuteAlways(7, 0, 1) // player is on the floor
			TNT1 A 0
			stop
		}
	}
If there's anything missing, do let me know!
User avatar
Isle
Posts: 687
Joined: Fri Nov 21, 2003 1:30 am
Location: Arizona, USA

Post by Isle »

nash, thats close, but instead of a projectile spawn a solid invisible thing just under the player, then check if it spawned. if it spawned then he is in the air.
example:

Code: Select all

script 1 ENTER
{
	while(1)
	{
		spawn("floored", getactorx(0), getactory(0), getactorz(0) - 1.0, 4);
		if(thingcount(0, 4)) print(s:"flying!");
		else print(s:"not");
		thing_remove(4);
		delay(1);
	}
}
for best results use a 16 radius by 1 height object
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Right. That would also get rid of the dependency of calling scripts from DECORATE!

I'm off to try that! *runs away, excited*
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

http://nash.wanzafran.com/doomstuff/floorchecker.zip

Doesn't work with GZDoom's 3-d floors.

Help! =(
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Well, it seems that the item isn't destroyed when it is spawned on 3-d floors.

I have to use the projectile method because I'll be using 3-d floors for the platforms in my game.

Hotwax... I hope you can take a look at my file when you get back...
Locked

Return to “Editing (Archive)”