is it possible to make a playerclass gradualy go faster as you hold forward?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
mr fiat
Frequent Poster Miles card holder
Posts: 858
Joined: Tue Jun 05, 2012 3:28 pm
Location: netherlands

is it possible to make a playerclass gradualy go faster as you hold forward?

#1

Post by mr fiat » Sun Aug 04, 2013 2:53 pm

as the title says, is it possible to make a playerclass gradualy go faster as you hold forward?

i dug around in the zdoom wiki asked others but i havnt found a suitable soloution yet.
Last edited by mr fiat on Sun Aug 04, 2013 2:53 pm, edited 1 time in total.

User avatar
CloudFlash
Zandrone
Posts: 1074
Joined: Mon Jun 04, 2012 5:35 pm
Location: Wonderland (except not really)

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#2

Post by CloudFlash » Sun Aug 04, 2013 2:56 pm

Did you try messing with A_ScaleVelocity in their see state?
https://i.imgflip.com/i5tpe.jpg
*Hey, who wants to hear my solution to the modern world's problems? ^Me! %Me! @Me! #Me! *WELL TOO BAD @Did he just stab himself with this butcher knife? %Looks like it ^Hey, the pizza guy arrived! %Pizza! Yey

User avatar
mr fiat
Frequent Poster Miles card holder
Posts: 858
Joined: Tue Jun 05, 2012 3:28 pm
Location: netherlands

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#3

Post by mr fiat » Sun Aug 04, 2013 3:08 pm

CloudFlash wrote: Did you try messing with A_ScaleVelocity in their see state?
hmmm il try that. altho i recall having used a similar action that caused some odd effects. (i could be wrong tho)

*edit*yes i tried this before and then it didnt work properly as i wanted it. and it still doesnt seem to what i expected it to do, but then i noticed that i only seemed to pick up speed when i was midair (not touching the ground) so i asume this function is mainly intended for projectiles. (or flying enemys?)
Last edited by mr fiat on Sun Aug 04, 2013 3:25 pm, edited 1 time in total.

User avatar
CloudFlash
Zandrone
Posts: 1074
Joined: Mon Jun 04, 2012 5:35 pm
Location: Wonderland (except not really)

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#4

Post by CloudFlash » Sun Aug 04, 2013 3:49 pm

A_ChangeVelocity?
https://i.imgflip.com/i5tpe.jpg
*Hey, who wants to hear my solution to the modern world's problems? ^Me! %Me! @Me! #Me! *WELL TOO BAD @Did he just stab himself with this butcher knife? %Looks like it ^Hey, the pizza guy arrived! %Pizza! Yey

User avatar
Ænima
Addicted to Zandronum
Posts: 3579
Joined: Tue Jun 05, 2012 6:12 pm

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#5

Post by Ænima » Sun Aug 04, 2013 4:14 pm

Use ACS. Specifically, GetPlayerInput.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#6

Post by Lollipop » Sun Aug 04, 2013 4:24 pm

A_ChangeVelocity should be able to do it, if you use it as you are supposed to :razz:

Inventory items solves all your shit:
Note though that you are supposed to exppiriment with this code to make it fit your liking, and that it is not some plugin that you can just throw in your project.
I am aware of what the CarSpeed actors inhert from, and what the wiki says, you should look at this page if you want to know more about the PowerSpeed actor.
Spoiler: This is not small (Open)
See:
A 0 A_JumpIfInventory(SpeedItem, 10, "Move10")
A 0 A_JumpIfInventory(SppedItem, 9, "Move9")
A 0 A_JumpIfInventory(SppedItem, 8, "Move8")
A 0 A_JumpIfInventory(SppedItem, 7, "Move7")
A 0 A_JumpIfInventory(SppedItem, 6, "Move6")
A 0 A_JumpIfInventory(SppedItem, 5, "Move5")
A 0 A_JumpIfInventory(SppedItem, 4, "Move4")
A 0 A_JumpIfInventory(SppedItem, 3, "Move3")
A 0 A_JumpIfInventory(SppedItem, 2, "Move2")
A 0 A_JumpIfInventory(SppedItem, 1, "Move1")
ROFLROFL: (intentional fall-through, this is where you put all your animation stuff)



Move10:
A_Giveinventory("Carspeed10", 1)
goto ROFLROFL
Move9:
A_Giveinventory("Carspeed9", 1)
goto ROFLROFL
Move8:
A_Giveinventory("Carspeed8", 1)
goto ROFLROFL
Move7:
A_Giveinventory("Carspeed7", 1)
goto ROFLROFL
Move6:
A_Giveinventory("Carspeed6", 1)
goto ROFLROFL
Move5:
A_Giveinventory("Carspeed5", 1)
goto ROFLROFL
Move4:
A_Giveinventory("Carspeed4", 1)
goto ROFLROFL
Move3:
A_Giveinventory("Carspeed3", 1)
goto ROFLROFL
Move2:
A_Giveinventory("Carspeed2", 1)
goto ROFLROFL
Move1:
A_Giveinventory("Carspeed1", 1)
goto ROFLROFL

actor speeditem : custominventory {}

ACTOR Carspeed10 : PowerSpeed
{
Powerup.Duration -1
Speed 3.0
Inventory.Icon "SPBOOT0"
}
ACTOR Carspeed9 : Carspeed10
{
Speed 2.8
}
ACTOR Carspeed8 : Carspeed10
{
Speed 2.6
}
ACTOR Carspeed7 : Carspeed10
{
Speed 2.4
}
ACTOR Carspeed6 : Carspeed10
{
Speed 2.2
}
ACTOR Carspeed5 : Carspeed10
{
Speed 2.0
}
ACTOR Carspeed4 : Carspeed10
{
Speed 1.8
}
ACTOR Carspeed3 : Carspeed10
{
Speed 1.6
}
ACTOR Carspeed2 : Carspeed10
{
Speed 1.4
}
ACTOR Carspeed1 : Carspeed10
{
Speed 1.2
}
If you got any questions regarding my code or if it dun work, just let me know.
Last edited by Lollipop on Sun Aug 04, 2013 4:27 pm, edited 1 time in total.
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

User avatar
mr fiat
Frequent Poster Miles card holder
Posts: 858
Joined: Tue Jun 05, 2012 3:28 pm
Location: netherlands

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#7

Post by mr fiat » Sun Aug 04, 2013 4:26 pm

Ænima wrote: Use ACS. Specifically, GetPlayerInput.
yea i already asumed it was going to involve acs, however im a total acs nab so i need help with that. :s

Cruduxy
Zandrone
Posts: 1059
Joined: Fri Jun 08, 2012 4:24 pm

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#8

Post by Cruduxy » Sun Aug 04, 2013 5:06 pm

A_Recoil(Negativevaluehere) and custominventory to control the recoil amount.. there you go!
[][][][][][][][][][][][][][][]
Nothing to see here
[][][][][][][][][][][][][][][]

User avatar
mr fiat
Frequent Poster Miles card holder
Posts: 858
Joined: Tue Jun 05, 2012 3:28 pm
Location: netherlands

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#9

Post by mr fiat » Sun Aug 04, 2013 5:34 pm

Cruduxy wrote: A_Recoil(Negativevaluehere) and custominventory to control the recoil amount.. there you go!
hmmm il try that but i have no clue what i should do with custom inventory.

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#10

Post by Lollipop » Sun Aug 04, 2013 5:39 pm

mr fiat wrote:
Cruduxy wrote: A_Recoil(Negativevaluehere) and custominventory to control the recoil amount.. there you go!
hmmm il try that but i have no clue what i should do with custom inventory.
Try what I wrote, that way you can control it.
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

Cruduxy
Zandrone
Posts: 1059
Joined: Fri Jun 08, 2012 4:24 pm

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#11

Post by Cruduxy » Sun Aug 04, 2013 5:43 pm

Use an inventory (Ammo,inventory,custom whatever one you find most fit) with jump states and you can have the player accelerate faster (more a_recoil) per inventory.. the more you are moving the more you are accelerating.. I persume this is for your cars mod so sidestep isnt a matter since cars DONT MOVE SIDEWAY UNLESS SPECIAL WHEELS
[][][][][][][][][][][][][][][]
Nothing to see here
[][][][][][][][][][][][][][][]

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#12

Post by Lollipop » Sun Aug 04, 2013 5:46 pm

Would be nice with a car that could drive sideways though :P
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#13

Post by Klofkac » Sun Aug 04, 2013 6:21 pm

What about

Code: Select all

//ACS part
script 666 (int running)
{
if(running) {
  SetActorProperty(0,APROP_SPEED,GetActorProperty(0,APROP_SPEED)+0.1)
 if(GetActorProperty(0,APROP_SPEED)>10.0) SetActorProperty(0,APROP_SPEED,10.0);
  } else SetActorProperty(0,APROP_SPEED,0.0)

//DECORATE part
states {
spawn:
  PLAY A 0 ACS_ExecuteAlways(666,0)
  PLAY A 1
  goto spawn+1
see:
  PLAY ABCD 2 ACS_ExecuteAlways(666,1)
  loop
}
I am not completely sure with DECORATE part, though...

Well, the drawback is, it won't work properly when one gets shot or shoots (pain, missile, etc)
Last edited by Klofkac on Sun Aug 04, 2013 6:40 pm, edited 1 time in total.
𝕂𝕝𝕠𝕗𝕜𝕒𝕔

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#14

Post by Ivan » Sun Aug 04, 2013 6:58 pm

Yeah, the decorate part is kinda broken in your example because you don't want to put any action on the spawn state on the very first line, it also doesn't help to make it go to spawn+1 as it will always ignore the command anyway.

Honestly, everyone here has given good suggestions. You can control recoil with items (very much in the way Jitterskull works in GvH, except without control items) or simply use all ACS, hell you can use both! It's really not too hard to use ACS if you have any examples to look at, and there are plenty of those around.
Last edited by Ivan on Sun Aug 04, 2013 7:00 pm, edited 1 time in total.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
CloudFlash
Zandrone
Posts: 1074
Joined: Mon Jun 04, 2012 5:35 pm
Location: Wonderland (except not really)

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#15

Post by CloudFlash » Sun Aug 04, 2013 7:01 pm

Why would cars be in pain state anyway? You aren't doing Mario Kart in Doom engine, are you? ._.
https://i.imgflip.com/i5tpe.jpg
*Hey, who wants to hear my solution to the modern world's problems? ^Me! %Me! @Me! #Me! *WELL TOO BAD @Did he just stab himself with this butcher knife? %Looks like it ^Hey, the pizza guy arrived! %Pizza! Yey

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#16

Post by Klofkac » Mon Aug 05, 2013 3:08 pm

Ok, I got a much better code this time and it does not rely on DECORATE, just pure ACS.

Code: Select all

script 1337 ENTER
{
	int speedMul = 0.0;
	while(GetActorProperty(0,APROP_Health)) //It MUST stop when player dies
	{
		if(!GetActorVelX(0)&&!GetActorVelY(0)&&!GetActorVelZ(0)) SpeedMul=0.1; //Le player crashed or stopped, reset acceleration!
		else if(GetPlayerInput(-1,INPUT_FORWARDMOVE)) // GAMEPAD COMPAT! GTFO BUTTONS!
		{
			SpeedMul+=0.1;
			if(SpeedMul>20.0) SpeedMul=20.0; //You don't want that car go infinitely fast, don't you?
		} else {
			SpeedMul-=0.5;
			if(SpeedMul<0.1) SpeedMul=0.1; //Negative speed multiplier? NOPE!
		}
		SetActorProperty(0,APROP_SPEED,SpeedMul); //Apply da multiplier!
		Delay(1);
	}
}

script 9001 RESPAWN
{
	ACS_ExecuteAlways(1337,0); //Start dat again.
}
You can tweak the acceleration by changing 0.1 to other number, same with max speed.
Don't take the script numbers seriously, change them
Oh and I wrote it quickly from scratch without even testing...


Or, just apply very low friction
Last edited by Klofkac on Mon Aug 05, 2013 4:10 pm, edited 1 time in total.
𝕂𝕝𝕠𝕗𝕜𝕒𝕔

User avatar
Ænima
Addicted to Zandronum
Posts: 3579
Joined: Tue Jun 05, 2012 6:12 pm

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#17

Post by Ænima » Mon Aug 05, 2013 3:47 pm

Klofkac wrote: Ok, I got a much better code this time and it does not rely on DECORATE, just pure ACS.

Code: Select all

script 1337 ENTER
{
	int speedMul = 0.0;
	while(GetActorProperty(0,APROP_Health)) //It MUST stop when player dies
	{
		if(!GetActorVelX(0)&&!GetActorVelY(0)&&!GetActorVelZ(0)) SpeedMul=0.1; //Le player crashed or stopped, reset acceleration!
		else if(GetPlayerInput(-1,INPUT_FORWARDMOVE)) // GAMEPAD COMPAT! GTFO BUTTONS!
		{
			SpeedMul+=0.1;
			if(SpeedMul>20.0) SpeedMul=20.0; //You don't want that car go infinitely fast, don't you?
		} else {
			SpeedMul-=0.5;
			if(SpeedMul<0.1) SpeedMul=0.1; //Negative speed multiplier? NOPE!
		}
		SetActorProperty(0,APROP_SPEED,SpeedMul); //Apply da multiplier!
		Delay(1);
	}
}

script 9001 RESPAWN
{
	ACS_ExecuteAlways(1337,0); //Start dat again.
}
You can tweak the acceleration by changing 0.1 to other number, same with max speed.
Don't take the script numbers seriously, change them
Oh and I wrote it from scratch without even testing...


Or, just apply very low friction
Yes, this is the way I recommended doing it. But for some reason I was ignored and you guys continued to suggest very hacky DECORATE methods ... :argh:

Klofkac's code does need some refining though. I'd post my script for the Mercenaries jeep (which even includes different gears) but I can't find where I put it. D:
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#18

Post by Klofkac » Mon Aug 05, 2013 4:04 pm

Ænima wrote: Yes, this is the way I recommended doing it. But for some reason I was ignored and you guys continued to suggest very hacky DECORATE methods ... :argh:
I was not agreeing with hacky DECORATE stuff, actually. Looked unnessecarilly complicated.
Looking through topic...
Ænima wrote: Use ACS. Specifically, GetPlayerInput.
Well, you could write it more detailed back then, like posting an example.
Ænima wrote: Klofkac's code does need some refining though.
Klofkac wrote: Oh and I wrote quickly it from scratch without even testing...
Ofc it needs refining.
Last edited by Klofkac on Mon Aug 05, 2013 4:10 pm, edited 1 time in total.
𝕂𝕝𝕠𝕗𝕜𝕒𝕔

User avatar
mr fiat
Frequent Poster Miles card holder
Posts: 858
Joined: Tue Jun 05, 2012 3:28 pm
Location: netherlands

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#19

Post by mr fiat » Mon Aug 05, 2013 4:05 pm

Ænima wrote:
Klofkac wrote: Ok, I got a much better code this time and it does not rely on DECORATE, just pure ACS.

Code: Select all

script 1337 ENTER
{
	int speedMul = 0.0;
	while(GetActorProperty(0,APROP_Health)) //It MUST stop when player dies
	{
		if(!GetActorVelX(0)&&!GetActorVelY(0)&&!GetActorVelZ(0)) SpeedMul=0.1; //Le player crashed or stopped, reset acceleration!
		else if(GetPlayerInput(-1,INPUT_FORWARDMOVE)) // GAMEPAD COMPAT! GTFO BUTTONS!
		{
			SpeedMul+=0.1;
			if(SpeedMul>20.0) SpeedMul=20.0; //You don't want that car go infinitely fast, don't you?
		} else {
			SpeedMul-=0.5;
			if(SpeedMul<0.1) SpeedMul=0.1; //Negative speed multiplier? NOPE!
		}
		SetActorProperty(0,APROP_SPEED,SpeedMul); //Apply da multiplier!
		Delay(1);
	}
}

script 9001 RESPAWN
{
	ACS_ExecuteAlways(1337,0); //Start dat again.
}
You can tweak the acceleration by changing 0.1 to other number, same with max speed.
Don't take the script numbers seriously, change them
Oh and I wrote it from scratch without even testing...


Or, just apply very low friction
Yes, this is the way I recommended doing it. But for some reason I was ignored and you guys continued to suggest very hacky DECORATE methods ... :argh:

Klofkac's code does need some refining though. I'd post my script for the Mercenaries jeep (which even includes different gears) but I can't find where I put it. D:
when i replied to your first comment i wasnt sure how to reply because you mentioned some acs functions which didnt realy tell me that much because as i said im a tottal acs nab (aka i cant do anything aside from some print messages with allot of reference :S)

also klof's code works like it should now, after he fine adjusted it.

Scott_Minikhiem
New User
Posts: 14
Joined: Mon Nov 19, 2012 12:46 am

RE: is it possible to make a playerclass gradualy go faster as you hold forward?

#20

Post by Scott_Minikhiem » Fri Sep 20, 2013 11:05 am

I have a script that changes the players speed to simulate him being tired... It works but it crashes could it be because the script(s) are still running on the dead player? Specifically it crashes on respawn

Post Reply