Jump to content

Scripting Help (For Entity Mod)


Recommended Posts

Posted

Hello, I'm trying to create a script that will make entities solid as soon as a duel ends. The reason is, in the japlus mod there's a short interval upon duel ending where the entity (player) isn't solid and can be glitched into other players or into the map. So far I've tried the following:


My icarus script:

set ( "SET_SOLID", "true" );


My entity mod:

{
"classname" "target_scriptrunner"
"count" "-1"
"victoryscript" "setSolid"
}



Any advice on how I may be able to achieve this would be greatly appreciated!

Posted

1: on INFO_PLAYER_START / INFO_PLAYER_DEATHMATCH make an USESCRIPT called mapname/intro.

2: inside that intro file on icarus you do:

affect player INSERT

SET_VICTORYSCRIPT mapname/victoryplayer

save and build.

3: now create the victoryplayer file on icarus.

put SET_SOLID, true on it.

save and build.

Got it! 🙂

 

PS: on SP sure it will works, not sure about MP. MP modding is not my field.

 

 

 

Posted

Aw, Craps. :(

That's glitch also happen into default vanilla MP? if is not, probably is a glitch caused by JA++ code, but i not think is possible to fix into that case. for what i know JA++ code was not open source, but i hope i'm wrong about it.

 

Posted

I have a friend that fixed it years ago and he lost the code / script he used so it is possible to fix I just don't remember how he did it. Also I'm not even sure my scripts are being loaded properly. Is there any way to check that?

Posted

In SP there's the g_icarusDebug cvar, but it looks like that doesn't exist in MP.

Maybe there's a JA+ specific cvar for controlling the nonsolid period after duels?

Posted

I’ve made a little progress. Current issue is it seems it isn’t applying it quick enough to stop the glitch. 
 

target_scriptrunner running ffa3/init on activator (null)
INFO: 63700 Script scripts/ffa3/init executed by player (null)
DEBUG: (null)(3): set( "SET_VICTORYSCRIPT", "ffa3/reward" ); [63725]
Kill: 0 2 2: Padawan killed Padawan (2) by MOD_MELEE
INFO: 65700 Script scripts/ffa3/reward executed by player (null)
DEBUG: (null)(0): wait( 50 ); [65725]
DEBUG: (null)(0): use( "UseReward" ); [65800]
target_scriptrunner running ffa3/setSolid on activator (null)
INFO: 65800 Script scripts/ffa3/setSolid executed by player (null)
DEBUG: (null)(0): set( "SET_SOLID", "TRUE" ); [65800]

 

It appears that "SET_SOLID" won't apply instantly. Is there a way to get stuff like this to apply changes as soon as it gets read?

Posted

Yea a 50 millisecond delay, that shouldn’t be noticeable at all though. I tested with setting SET_SOLID to false and it worked perfectly (as far as duel ending and event firing instantly). Idk why it seems there’s a delay when I set it to true.

 

Even without the delay it doesn't instantly apply it.
 

INFO: 81500 Script scripts/ffa3/init executed by player (null)
DEBUG: (null)(0): set( "SET_VICTORYSCRIPT", "ffa3/reward" ); [81525]
Kill: 1 2 2: Padawan killed Padawan (2) by MOD_MELEE
INFO: 84000 Script scripts/ffa3/reward executed by player (null)
DEBUG: (null)(1): use( "UseReward" ); [84025]
target_scriptrunner running ffa3/setSolid on activator (null)
INFO: 84025 Script scripts/ffa3/setSolid executed by player (null)
DEBUG: (null)(1): set( "SET_SOLID", "true" ); [84025]

 

Edit: It would appear it works whenever a player respawns, perhaps because I have it targeted on player spawn. Is there a way to target players while they are actively playing?

Posted

These are my scripts.

/////ffa3/init/////
set ( /*@SET_TYPES*/ "SET_VICTORYSCRIPT", "ffa3/reward" );

/////ffa3/reward/////
use ( "UseReward" );

/////ffa3/setSolid/////
task ( "applySolid" )
{

	affect ( "UseReward", /*@AFFECT_TYPE*/ INSERT )
	{
		set ( "SET_SOLID", "true" );
	}

}

do ( "applySolid" );

 

This is my entity mod for FFA3. Of course I have 16 some odd spawns so.

{
"angle" "270"
"origin" "728 1424 -56"
"classname" "info_player_deathmatch"
"target" "player_spawn_1"
}
{
"classname" "target_delay"
"wait" "0.0"
"targetname" "player_spawn_1"
"target" "PlayerSpawn"
}
{
"classname" "target_scriptrunner"
"count" "-1"
"targetname" "PlayerSpawn"
"usescript" "ffa3/init"
"spawnflags" "1"
}
{
"classname" "target_scriptrunner"
"count" "-1"
"targetname" "UseReward"
"usescript" "ffa3/setSolid"
"spawnflags" "1"
}
Smoo likes this
Posted

Why the target_delay? Why the task? Why the UseReward target_scriptrunner?

I'd try it like this:

{
"angle" "270"
"origin" "728 1424 -56"
"classname" "info_player_deathmatch"
"target" "PlayerSpawn"
}
{
"classname" "target_scriptrunner"
"count" "-1"
"targetname" "PlayerSpawn"
"usescript" "ffa3/init"
"spawnflags" "1"
}

with scripts

/////ffa3/init/////
set ( /*@SET_TYPES*/ "SET_VICTORYSCRIPT", "ffa3/reward" );

/////ffa3/reward/////
set ( "SET_SOLID", "true" );

 

Smoo likes this
Posted

The target_delay is tied to each individual spawn and links them all to the target of PlayerSpawn. Like I said, I have 16 some odd spawns. Also the task is an attempt from the icarus manual. 

Posted

I still don't understand the purpose of the target_delay. Why not target all the spawns directly to the scriptrunner? And either way, instead of a target_delay with wait 0, you should use a target_relay for clarity.

Posted

It doesn't work with either of those, it only works with the target_delay. And either way it isn't applying it to the correct entity. I don't know how else to make the script apply to the correct entity (the person that got the kill).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...