player.vehicleHp only works in multiplayer?

Ask questions, discuss ideas, get answers

player.vehicleHp only works in multiplayer?

Postby Skull Kid » Thu Jun 14, 2018 10:52 pm

This was kind of a handy command. It changes the current hitpoints of the player, but it only seems to work in multiplayer. When I try it in single player, even by using the player.active command, followed by my player id, it doesn't work at all in single player.
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 124
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: player.vehicleHp only works in multiplayer?

Postby Swaffy » Fri Jun 15, 2018 2:13 am

My guess is that certain commands are server based and not client. Local server counting as that.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Image
User avatar
Swaffy
 
Posts: 1712
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: player.vehicleHp only works in multiplayer?

Postby Skull Kid » Fri Jun 15, 2018 2:17 am

I see. Well, not much I can do about it then.
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 124
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: player.vehicleHp only works in multiplayer?

Postby Skull Kid » Wed Sep 12, 2018 8:26 pm

I'm also right now trying to make the console show my vehicle ID, without typing "object.listobjectsoftemplate" and then the objects name.

Anyone who can come up with a solution for this, I'd be extremely grateful!

NOTE: This is for Single Player.
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 124
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: player.vehicleHp only works in multiplayer?

Postby Skull Kid » Sat Feb 09, 2019 9:26 pm

I finally got the player.vehicleHp to work! The player.active command only "seem" to work with one argument, in other words, a name without any spaces. Not even quotation marks seems to help… strange.

EDIT: It can be partly fixed when naming yourself with the alias name "yourname", then re-naming yourself to whatever, and you are still the selected player. But for bots, I have no clue on how to select them.
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 124
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: player.vehicleHp only works in multiplayer?

Postby russ » Tue Feb 12, 2019 6:04 am

Super stubborn

var v_name = "Z Fighter"
player.active v_name

Doesn't even work.
russ
 
Posts: 72
Joined: Sun Oct 29, 2017 8:12 am

Re: player.vehicleHp only works in multiplayer?

Postby Skull Kid » Tue Feb 12, 2019 8:36 am

Hmm... need to do further troubleshooting with this...
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 124
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: player.vehicleHp only works in multiplayer?

Postby Diamondback » Tue Feb 12, 2019 2:24 pm

Var v_ID = 10
Player.active v_ID ?
{SoH} Clan Leader // http://sohclan.forumotion.com/
See my Strasbourg map project here.
GSC: diamondback67
Steam: diamondback67
Diamondback
 
Posts: 486
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada

Re: player.vehicleHp only works in multiplayer?

Postby russ » Tue Feb 12, 2019 7:07 pm

Classical Modder wrote:Var v_ID = 10
Player.active v_ID ?


The console object for this one uses a ostream/istream class for parsing to/from an IPlayer* and an std::string. If overloads operator>> and operator<< to then do the actual lookups. Unfortunately istream tokenizes input. There's no way for a space to get past it without modifying the code.
russ
 
Posts: 72
Joined: Sun Oct 29, 2017 8:12 am

Re: player.vehicleHp only works in multiplayer?

Postby Diamondback » Wed Mar 06, 2019 3:42 pm

This is still a great discovery. Well done SkullKid! player.active can be used for many different applications. Time to try out the code.

If you want to make it work for bots then rename the bots name in the Skirmish.con file so that they do not have a second name. That would eliminate the problem with the player.active command.
{SoH} Clan Leader // http://sohclan.forumotion.com/
See my Strasbourg map project here.
GSC: diamondback67
Steam: diamondback67
Diamondback
 
Posts: 486
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada

Next

Return to 1942 Modding Discussion

Who is online

Users browsing this forum: No registered users and 43 guests

cron