Jump to content

Development of the Purchase Terminal


Ruud033

Recommended Posts

Hey guys,

Im using this post for discussion. I'm trying to switch the Purchase terminal's team via Kismet (Modify Property) This works server side.

However, client side, it does not update in a multiplayer game, so I think it has somethign to do with replication.

At the moment i'm using mutators to test the code. This is what I have so far;

It's mostly a copy of Rx_BuildingAttachment_PT.uc

TestPT.uc

class TestPT extends Rx_BuildingAttachment implements (Rx_ObjectTooltipInterface)
abstract;

var TEAM                    TeamNum;
var CylinderComponent       CollisionCylinder;
var StaticMeshComponent PTMesh;
var bool bAccessable;
var string tooltip;

simulated function string GetTooltip(Rx_Controller PC)
{
if (PC.GetTeamNum() == GetTeamNum() && class'Rx_Utils'.static.OrientationToB(self, PC.Pawn) > 0.1)
	return Repl(tooltip, "{GBA_USE}", Caps(UDKPlayerInput(PC.PlayerInput).GetUDKBindNameFromCommand("GBA_Use")), true);
return "";
}

simulated function bool IsTouchingOnly()
{
return true;
}

simulated function bool IsBasicOnly()
{
return false;
}

simulated function string GetHumanReadableName()
{
return "Hacked Purchase Terminal";
}

simulated event byte ScriptGetTeamNum()
{
return TeamNum;
}

simulated function bool AreAircraftDisabled()
{
local Rx_MapInfo mi;
mi = Rx_MapInfo(WorldInfo.GetMapInfo());
if( mi != none )
{
	return mi.bAircraftDisabled;
}
return true;
}

simulated function StartCreditTick()
{
SetTimer(0.5f,true,'CreditTick');
}

simulated function StopCreditTick()
{
if (IsTimerActive('CreditTick'))
{
	ClearTimer('CreditTick');
}	
}


simulated function StartInsufCreditsTimeout()
{
SetTimer(5.0f,false,'InsufCreditsTimeout');
}

simulated function StopInsufCreditsTimeout()
{
if (IsTimerActive('InsufCreditsTimeout'))
{
	ClearTimer();
}	
}

replication
{
if ( bNetDirty && ROLE == ROLE_Authority)
 TeamNum, tooltip;
}

defaultproperties
{
SpawnName     = "_PT"
SocketPattern = "Pt_"

RemoteRole          = ROLE_SimulatedProxy //should this not be ROLE_AutonomousProxy?
CollisionType       = COLLIDE_TouchAllButWeapons
bCollideActors      = True
bAccessable = true;
tooltip = "Press [ {GBA_USE} ] to access the PURCHASE TERMINAL";
bAlwaysRelevant    			= True
bGameRelevant     			= True
bOnlyDirtyReplication		= True

NetUpdateFrequency=10.0

Begin Object Class=StaticMeshComponent Name=PTMeshCmp
	StaticMesh                   = StaticMesh'rx_deco_terminal.Mesh.SM_BU_PT'
	CollideActors                = True
	BlockActors                  = True
	BlockRigidBody               = True
	BlockZeroExtent              = True
	BlockNonZeroExtent           = True
	bCastDynamicShadow           = True
	bAcceptsDynamicLights        = True
	bAcceptsLights               = True
	bAcceptsDecalsDuringGameplay = True
	bAcceptsDecals               = True
	RBChannel                    = RBCC_Pawn
	RBCollideWithChannels        = (Pawn=True)
End Object
Components.Add(PTMeshCmp)
PTMesh = PTMeshCmp

Begin Object Class=CylinderComponent Name=CollisioncMP
	CollisionRadius     = 75.0f
	CollisionHeight     = 50.0f
	BlockNonZeroExtent  = True
	BlockZeroExtent     = false
	bDrawNonColliding   = True
	bDrawBoundingBox    = False
	BlockActors         = False
	CollideActors       = True
End Object
CollisionComponent = CollisionCmp
CollisionCylinder  = CollisionCmp
Components.Add(CollisionCmp)


//RemoteRole          = ROLE_SimulatedProxy
//bCollideActors      = True
//bBlockActors        = True
//BlockRigidBody      = True
//bCollideComplex     = true
//bWorldGeometry = true

}

I use this as a base, in the original PT's there is also a base for the PT's. Since I had to modify this code I have made a copy and thus a new base. The placeable actor is as follows:

TestPT_Placeable.uc

class TestPT_Placeable extends TestPT
   placeable;

defaultproperties
{
TeamNum = 255
}

I've only been editing in TestPT.uc so far to get the stuff rolling.

I think this code is the most important, RypeL also mentioned this;

replication
{
if ( bNetDirty && ROLE == ROLE_Authority)
 TeamNum, tooltip;
}

However, it still does not work, ive tested this already in the CT server.

Link to comment
Share on other sites

F*ck man, I'm all out of options! I've tried everything, even asked Agent for help and she couldn't help me out.

I've tried all combinations with:

RemoteRole = ROLE_AutonomousProxy

if(bNetDirty && ROLE == ROLE_Authority)

if(bNetDirty || bNetInitial)

And other stuffs i forgot to mention and I'm kinda sick of it. I have the feeling that we're coming from a wrong code hierachy here, I'll do an analysis of the code hierachy and base my new PT upon the capturable MCT. Why? Because I know that atleast works.

Did some hierachy research, see the attached picture. I think I'll be extending from:

- Rx_Building_Techbuilding

- Rx_Building_Team_Internals

For the second item, i'll just copy paste (the existing) Rx_Building_Techbuilding_Internals and get rid of all the health related stuff. I'll also delete the RxIFC_Capturable implementation. This way we can not capture or give health to the newly created extension.

Then only 1 thing also remains, that is the default TeamID, I'll add that as well.

So this is what im gonna do:

VSFZ5ah.png

http://prntscr.com/8i9krt

I really really REALLY do not know why the TestPT does not work at all, it really frustrates me. I've been looking at code inside of Rx_Building_Attachment and could not find out how what or why it functions in terms of replication.

Anyways, I'm trying to make a new PT actor this way, if this works, huuray!! if it does not, I'm giving up on this. I'll then just create and destroy actors in Kismet I think (IF that works, didnt even test that yet)

God this is frustrating..

Link to comment
Share on other sites

Now you got a glimpse of what it felt like making the game :D And about how frustrating that can be at times.

But you dont give up. I respect that and would like to help, but after looking through the code i cant spot an error just yet. Might have to take a closer look on the mutator you made and the kismet along with it. Some tests should reveal the problem. Maybe i have some time for that next week.

Link to comment
Share on other sites

Now you got a glimpse of what it felt like making the game :D And about how frustrating that can be at times.

But you dont give up. I respect that and would like to help, but after looking through the code i cant spot an error just yet. Might have to take a closer look on the mutator you made and the kismet along with it. Some tests should reveal the problem. Maybe i have some time for that next week.

Yeah I sort of get the frustration there :P

That would be nice, if you can take a look at it. Meanwhile i'm continuing experimentation.

Which part doesn't work? I thought we've cleared that out?

The replication part does not work. The ingame UI does not update, so that is reason for me to bug out on the current way of thinking and going into a different code hierachy by extending (pluggin into) a different hierachy, namely, the one from the capturable MCT because I know that works.

Next post will be about the combinations I've already tried and the kismet I'm using.

Link to comment
Share on other sites

So first of, the Kismet, I'm posting the Kismet first because, when you guys reply, you have to scroll up and the code is more important to refer to, and will be the first thing you encounter when replying so.. anyways, lets begin;

Note: If any of the screenshots's links are broken, report back in, I'll re-upload them.

First of, the general overview:

F49NDyh.png

http://prntscr.com/8idfbb

Here you see that I use level loaded in the beginning to set a number of parameters when the level loads. These parameters are as following:

YkjTpeW.png

http://prntscr.com/8idge8

See the screenshot for the complete thing. In short:

- bAccessable gets set to False

- ToolTip gets set to Press [ {GBA_USE} ] to buy an Orca [900 credits] or something similar for other vehicles

- TeamNum gets set to 3, because the MCT also starts out at TeamNum=3 from the start.

The settlement of the team could also start out at 255 but, at first I had a different kismet sequence which involved a comparison between one of the PT's as victim for measurement. I had a sequence that involved checking whether the PT's were not already set to a team, and if they were already at, say, GDI, they won't get assigned the set of properties again when the MCT is also at GDI. I will include this sequence again in the future, to reduce the amount of re-assigning. Therefore it needs to start out at team 3 because then A==B and it won't update properties when someone triggers the update. For now, we need to fix the replication first so forget that you've just read this.

Here you can see that I use a couple of trigger volumes to initiate a comparison in Kismet between the MCT as object variable and 3 different teamnumbers, namely:

- GDI (team 0)

- Nod (team 1)

- Neutral (team 255)

If one of these match up, the PT's will get a set of properties assigned to them because A == B.

The set of properties consist of:

iyo3GWR.png

http://prntscr.com/8idi7z

- bAccessable tickbox not being ticked for modification since it's properly set at Level Loaded

- ToolTip tickbox not being ticked for modification since it's properly set at Level Loaded

- TeamNum set to (GDI in this case, GDI is team 0) the correct team

This was the Kismet sequence, It's quite simple. Now we move on to the code part

So, for a quick summary before you start spitting trough the code which is already posted:

I've made a mutator based upon the existing PT code. I did not extend the existing PT code but I decided to completely make a custom PT based upon a copy of the existing one.

So what does this mean? I copy-pasted Rx_BuildingAttachment_PT.uc and BuildingAttachment_PT_GDI.uc and renamed them both in filename, and internally, in the file itself, so the extensions etc.. all work out.

(class Rx_BuildingAttachment_PT_GDI extends Rx_BuildingAttachment_PT) <-- that stuff.

(class TestPT_Placeable extends TestPT) <--- into that stuff

Why did I do this and not just extend Rx_BuildingAttachment_PT? Because I now had an overview of the used code and hierachy used. I'm not a coder with awesome coding skills and an advanced IDE program, mostly I just use Notepad++ for these things. I have an IDE program but I don't know how to use that properly.

So what I've been doing is adding bits and pieces to TestPT_Placeable.uc because I have already placed TestPT.uc in my level (Crash_Site). I can then update the mutator's code and quickly test it out by replacing the mutator only.

Untill this far I've added these pieces of code (with partial succes thus far, will get back to this) for experimentation, but have failed me so far.

First I started out with this:

x. Test number 0.5 (because it failed before building scripts)

replication
{
if ( bNetDirty)
 TeamNum;
}

And also this second piece:

replication
{
if ( bNetDirty)
 Armor, ArmorMax, CurrentBackWeapons, AirstrikeLocation;
}

Because RypeL had sent this to me via Skype. Quickly after lots of errors and UDKFrontend.exe bleeding and screaming to me I figured that I didnt need the second part involving Armor, Armormax etc.. because we're not having any of those variables in the PT anyway, so I deleted the second piece and was left over with test number 1:

replication
{
if ( bNetDirty)
 TeamNum;
}

Rebuilding scripts with the first piece of code only did work, however, it failed to replicate ingame.

So I've been researching a lot into replication and looking at the existing code of the capturable MCT.

I have then tried this:

2. Test number 2

replication
{
if(bNetDirty && ROLE == ROLE_Authority)
TeamNum, tooltip;
}

That didnt work for me either. I can remember it only worked once or twice by accident but after several testing runs it didnt work out anymore. During the one or two times it did work, I was alone in the server. I did notice the ToolTip was set properly. So short conclusion: The tooltip and the bAccessable variables get set properly! (good job Agent!)

I figured it had something to do with server-client replication. So I've tried reconnecting with test number 2 and voila! The PT UI updated. (In other words, bNetInitial fired I think or some magic happened)

With that knowledge in mind, I have done some experimenting.

3. Test number 3

replication
{
if(bNetDirty || bNetInitial)
	TeamNum, tooltip;
}

This piece of code was in Rx_Building_Techbuilding_Internals.uc I had copied this piece of code because I know the captureable MCT (which uses this) works.

Sadly this piece of code didnt work for me. I find it really strange that the Logic || OR is there and the capturable MCT still works but that's a different story.

To finish up the replication function write-out, I'm ending with a hypothesis:

http://wiki.beyondunreal.com/Everything ... _to_ask%29

I think bNetDirty is not the way to go to fire the replication on the server:

bNetDirty2,3

True whenever variables changed on the actor. To be honest I'm not entirely sure why this exists as variables always only get replicated if they changed from what the server thinks the client's value is.

So, I think the server does not know if the client's variable has changed or not. Maybe we need to use a different boolean to shake up things and get this script working?!?

So, I turned my head into different RemoteRoles.

I figured that if I could change the Role of the actor the bNetDirty would fire somehow.. Don't ask me why I'm thinking this but it's a guess I made. I've been reading that link I gave you in my hypothesis.

4. Test number 4

So I've tried this piece of code (because I think it might work best and also matches existing code on RenX buildings etc etc.. its still a guess though):

replication
{
if(bNetDirty && ROLE == ROLE_Authority)
TeamNum, tooltip;
}

With this role:

RemoteRole = ROLE_SimulatedProxy

That did'nt work. Same situation as before

5. Test number 5

So I've tried changing the role into:

RemoteRole = ROLE_AutonomousProxy

That didn't work out either. Same situation as before

6. Test number 6

So I've tried changing the role into:

RemoteRole = ROLE_Authority

That didn't work either.

So. I got kinda stuck, out of fury and frustration I even tried several combo's of Roles and replication functions.. those didnt work either. I already deleted those and I don't remember what they exactly were so I didnt post them.

Till this far my experimentation readout. We've now reached the present in terms of chronology

With all these setbacks I began to wonder If I could not approach this issue in a different way by doing an analysis of an existing WORKING object first. I decided to take the capturable MCT (Rx_CapturableMCT.uc) as a study object and try to learn something from it.

The biggest difference between the TestPT.uc and Rx_CapturableMCT.uc is that they come from a different hierachy. See also: http://prntscr.com/8i9krt

I've studied the hierachy and could only find ONE significant difference with these 2, namely:

- The TestPT.uc hierachy replicates in Rx_BuildingAttachment via:

replication
{
  if ( bNetInitial && Role==ROLE_Authority )
  OwnerBuilding;
}

and

- The Rx_CapturableMCT.uc hierachy replicates in Rx_Building_TechBuilding_Internals via:

replication
{
if(bNetDirty || bNetInitial)
	ReplicatedTeamID,FlagTeam,CP;
}

Now I've written everything I know in this post. I'm at the end of my knowledge here. I'm gonna try and build a new PT out of the Rx_CapturableMCT.uc hierachy as I said earlier (the post with the picture in it) and see how that goes. If any of the coders has ANY idea how to fix the replication in the original TestPT.uc I'll be anxious to hear that, I have absolutely no clue what so ever how to solve this other than rebuilding the PT from a different hierachy.

- Signing off for this post,

Ruud

Link to comment
Share on other sites

I dunno if this will work, but have you tried creating your own SeqAct action? Set Variable doesn't seem to be reliable imo

I have thought of it, but I think it's not a solution of any kind.

If I am creating an event, I'd have to have an input of some kind. bNetDirty is such an event already and is hard coded into the game, why would I replace this? I'd rather not be dependable upon such an event at all!

If I wanted to create an event, I'd have to create a 'replicate' INPUT node. So, that if we use kismet to do something, we fire to the input of this node, so the code can then take over and set the boolean to true, and replicate stuff. This way we work ourselves around the issue that the server can not see the clien't value, by using kismet as in input. You see, the problem here is the input, the trigger, the start that sets the wheel in motion (bNetDirty)

First I'll try and build a custom PT out of a different code hierachy, then i'll look into replacing bNetDirty as a variable completely.

Link to comment
Share on other sites

Development so far in the new code hierachy:

Rx_ChangeablePT.uc

class Rx_ChangeablePT extends Rx_Building_Techbuilding
  placeable;

var StaticMeshComponent PTMesh;
var CylinderComponent CollisionCylinder;
var bool bAccessable;
var string tooltip;
var string PTname;
var TEAM ReplicatedTeamID;

replication
{
if(bNetDirty || bNetInitial)
	ReplicatedTeamID;
}

simulated function string GetTooltip(Rx_Controller PC)
{
if (PC.GetTeamNum() == GetTeamNum() && class'Rx_Utils'.static.OrientationToB(self, PC.Pawn) > 0.1)
	return Repl(tooltip, "{GBA_USE}", Caps(UDKPlayerInput(PC.PlayerInput).GetUDKBindNameFromCommand("GBA_Use")), true);
return "";
}

simulated function bool IsTouchingOnly()
{
return true;
}

simulated function bool IsBasicOnly()
{
return false;
}

simulated function string GetHumanReadableName()
{
return PTname;
}

simulated event byte ScriptGetTeamNum()
{
return ReplicatedTeamID;
}

simulated function bool AreAircraftDisabled()
{
local Rx_MapInfo mi;
mi = Rx_MapInfo(WorldInfo.GetMapInfo());
if( mi != none )
{
	return mi.bAircraftDisabled;
}
return true;
}

simulated function StartCreditTick()
{
SetTimer(0.5f,true,'CreditTick');
}

simulated function StopCreditTick()
{
if (IsTimerActive('CreditTick'))
{
	ClearTimer('CreditTick');
}	
}

simulated function StartInsufCreditsTimeout()
{
SetTimer(5.0f,false,'InsufCreditsTimeout');
}

simulated function StopInsufCreditsTimeout()
{
if (IsTimerActive('InsufCreditsTimeout'))
{
	ClearTimer();
}	
}

defaultproperties
{

BuildingInternalsClass  = Rx_Building_ChangeablePT_Internals

Begin Object Class=StaticMeshComponent Name=PTMeshCmp
	StaticMesh                   = StaticMesh'rx_deco_terminal.Mesh.SM_BU_PT'
	CollideActors                = True
	BlockActors                  = True
	BlockRigidBody               = True
	BlockZeroExtent              = True
	BlockNonZeroExtent           = True
	bCastDynamicShadow           = True
	bAcceptsDynamicLights        = True
	bAcceptsLights               = True
	bAcceptsDecalsDuringGameplay = True
	bAcceptsDecals               = True
	RBChannel                    = RBCC_Pawn
	RBCollideWithChannels        = (Pawn=True)
End Object
Components.Add(PTMeshCmp)
PTMesh = PTMeshCmp

Begin Object Class=CylinderComponent Name=CollisioncMP
	CollisionRadius     = 75.0f
	CollisionHeight     = 50.0f
	BlockNonZeroExtent  = True
	BlockZeroExtent     = false
	bDrawNonColliding   = True
	bDrawBoundingBox    = True
	BlockActors         = False
	CollideActors       = True
End Object
CollisionComponent = CollisionCmp
CollisionCylinder  = CollisionCmp
Components.Add(CollisionCmp)

bAccessable = Rx_Building_ChangeablePT_Internals.bAccessable
tooltip = Rx_Building_ChangeablePT_Internals.tooltip
PTname = Rx_Building_ChangeablePT_Internals.PTname
ReplicatedTeamID = Rx_Building_ChangeablePT_Internals.ReplicatedTeamID


}

And the internals class that goes with it:

Rx_Building_ChangeablePT_Internals

class Rx_Building_ChangeablePT_Internals extends Rx_Building_Team_Internals
notplaceable;

var TEAM ReplicatedTeamID;
var bool bAccessable;
var string tooltip;
var string PTname;

DefaultProperties
{
CollisionType = COLLIDE_TouchAllButWeapons
bCollideActors = True
bAccessable = true;
tooltip = "Press [ {GBA_USE} ] to access the PURCHASE TERMINAL";
PTname = "Hacked Purchase Terminal"
ReplicatedTeamID = 255
}

This gives me a few warnings in the compiler though:

Warning/Error Summary

---------------------

F:\Program Files\Renegade X Beta5\SDK\Development\Src\TestPT\Classes\Rx_ChangeablePT.uc(118) : Warning, Invalid property value in defaults: bAccessable = Rx_Building_ChangeablePT_Internals.bAccessable

F:\Program Files\Renegade X Beta5\SDK\Development\Src\TestPT\Classes\Rx_ChangeablePT.uc(119) : Warning, Missing '"' in string default properties: tooltip = Rx_Building_ChangeablePT_Internals.tooltip

F:\Program Files\Renegade X Beta5\SDK\Development\Src\TestPT\Classes\Rx_ChangeablePT.uc(120) : Warning, Missing '"' in string default properties: PTname = Rx_Building_ChangeablePT_Internals.PTname

F:\Program Files\Renegade X Beta5\SDK\Development\Src\TestPT\Classes\Rx_ChangeablePT.uc(121) : Warning, Invalid property value in defaults: ReplicatedTeamID = Rx_Building_ChangeablePT_Internals.ReplicatedTeamID

Success - 0 error(s), 4 warning(s)

Execution of commandlet took: 4.94 seconds

[sep 21, 2:32 ] COMMANDLET 'UDK.exe make' SUCCEEDED

Link to comment
Share on other sites

I gave up on the code above (extending from a different hierachy) it's all so confusing and I can't figure it out. I think its best to have a custom node.

I dunno if this will work, but have you tried creating your own SeqAct action? Set Variable doesn't seem to be reliable imo

You mean a custom node? Could you create one? I know you have created one before in the past..

I also need that sequence where you can use the captured and neutralised points @ the MCT.

Meanwhile i've been experimenting in kismet with destroying and spawning actors (which seems to be OK..)

http://prntscr.com/8iuu7t

qgLpFG5.png

Link to comment
Share on other sites

It shouldn't have something to do with the hierarchy so that it shouldnt matter what class you extend from.

First I would try to find out if it's a kismet problem or a code problem. For that you could add a timer directly in the code of the PT class to change the teamnum value. Then start a server locally and see if that replicates properly (for examples on timers you can search for settimer (... function usage in the code.

Link to comment
Share on other sites

  • Totem Arts Staff

bAccessable = Rx_Building_ChangeablePT_Internals.bAccessable
tooltip = Rx_Building_ChangeablePT_Internals.tooltip
PTname = Rx_Building_ChangeablePT_Internals.PTname
ReplicatedTeamID = Rx_Building_ChangeablePT_Internals.ReplicatedTeamID

This can't be done in default properties, use PostBeginPlay function....

Link to comment
Share on other sites

It shouldn't have something to do with the hierarchy so that it shouldnt matter what class you extend from.

First I would try to find out if it's a kismet problem or a code problem. For that you could add a timer directly in the code of the PT class to change the teamnum value. Then start a server locally and see if that replicates properly (for examples on timers you can search for settimer (... function usage in the code.

I will try, if I have spare time.. the thing I'm working on right now seems to be an outcome ..

This can't be done in default properties, use PostBeginPlay function....

Ah yes, thanks for the tip. Will adjust and try one last time.

By the way, could you upload that piece of code you have written for the capturable MCT? That SeqAct? That fires when neutralised and when captured? Thanks in advance,

Edit: found it viewtopic.php?f=136&t=75458&hilit=MCT

Link to comment
Share on other sites

  • Totem Arts Staff

SeqAct and stuff is not that complex. I grasped its' logic while looking at AI's ScriptedMove function that uses kismet to fire up

So you can essentially look around my kismet scripting if you want. I reckon you can understand my scripting better than the original source

Link to comment
Share on other sites

With the help of your script I've cleaned up the kismet. I am now destroying - creating actors and therefore FORCING bNetInitial to fire. Therefore the PT's will get replicated in any situation.

This is the new kismet (works in the SDK, works in server)

http://prntscr.com/8j66v6

jbxxPDk.png

Edit: works in server, just the Modify Property that does not update by itself.. The PT UI's now spawn properly, but the only thing is the tooltip and bAccesssable don't get changed..

Edit2: nope can't get it to work, i'm gonna try n build a replication node seq event

Link to comment
Share on other sites

So, I'm chatting with HandEpsilon for a sec now, and I'm using this post to show where we're at;

TestPT.uc

class TestPT extends Rx_BuildingAttachment implements (Rx_ObjectTooltipInterface)
abstract;

var CylinderComponent CollisionCylinder;
var StaticMeshComponent PTMesh;
var repnotify TEAM TeamNum;
var repnotify bool bAccessable;
var repnotify string tooltip;
var repnotify string PTname;

function kismetrep(UTSeqAct_ReplicatePT)
{
// what to do here??
}

replication
{
if(bNetDirty && ROLE == ROLE_Authority)
TeamNum, tooltip, bAccessable, PTname;
}

simulated function string GetTooltip(Rx_Controller PC)
{
if (PC.GetTeamNum() == GetTeamNum() && class'Rx_Utils'.static.OrientationToB(self, PC.Pawn) > 0.1)
	return Repl(tooltip, "{GBA_USE}", Caps(UDKPlayerInput(PC.PlayerInput).GetUDKBindNameFromCommand("GBA_Use")), true);
return "";
}

simulated function bool IsTouchingOnly()
{
return true;
}

simulated function bool IsBasicOnly()
{
return false;
}

simulated function string GetHumanReadableName()
{
return PTname;
}

simulated event byte ScriptGetTeamNum()
{
return TeamNum;
}

simulated function bool AreAircraftDisabled()
{
local Rx_MapInfo mi;
mi = Rx_MapInfo(WorldInfo.GetMapInfo());
if( mi != none )
{
	return mi.bAircraftDisabled;
}
return true;
}

simulated function StartCreditTick()
{
SetTimer(0.5f,true,'CreditTick');
}

simulated function StopCreditTick()
{
if (IsTimerActive('CreditTick'))
{
	ClearTimer('CreditTick');
}	
}

simulated function StartInsufCreditsTimeout()
{
SetTimer(5.0f,false,'InsufCreditsTimeout');
}

simulated function StopInsufCreditsTimeout()
{
if (IsTimerActive('InsufCreditsTimeout'))
{
	ClearTimer();
}	
}

defaultproperties
{
SpawnName     = "_PT"
SocketPattern = "Pt_"
CollisionType       = COLLIDE_TouchAllButWeapons
bCollideActors = True
bAccessable = true
tooltip = "Press [ {GBA_USE} ] to access the PURCHASE TERMINAL"
PTname = "Hacked Purchase Terminal"

Begin Object Class=StaticMeshComponent Name=PTMeshCmp
	StaticMesh                   = StaticMesh'rx_deco_terminal.Mesh.SM_BU_PT'
	CollideActors                = True
	BlockActors                  = True
	BlockRigidBody               = True
	BlockZeroExtent              = True
	BlockNonZeroExtent           = True
	bCastDynamicShadow           = True
	bAcceptsDynamicLights        = True
	bAcceptsLights               = True
	bAcceptsDecalsDuringGameplay = True
	bAcceptsDecals               = True
	RBChannel                    = RBCC_Pawn
	RBCollideWithChannels        = (Pawn=True)
End Object
Components.Add(PTMeshCmp)
PTMesh = PTMeshCmp

Begin Object Class=CylinderComponent Name=CollisioncMP
	CollisionRadius     = 75.0f
	CollisionHeight     = 50.0f
	BlockNonZeroExtent  = True
	BlockZeroExtent     = false
	bDrawNonColliding   = True
	bDrawBoundingBox    = False
	BlockActors         = False
	CollideActors       = True
End Object
CollisionComponent = CollisionCmp
CollisionCylinder  = CollisionCmp
Components.Add(CollisionCmp)

//RemoteRole          = ROLE_Authority
//bCollideActors      = True
//bBlockActors        = True
//BlockRigidBody      = True
//bCollideComplex     = true
//bWorldGeometry 		= true

}

and the Sequence

UTSeqAct_ReplicatePT.uc

class UTSeqAct_ReplicatePT extends SequenceAction;

defaultproperties
{
Variablelinks(4)=(ExpectedType=class'SeqVar_Bool', LinkDesc="Accessible",MinVars=1,MaxVars=1)
Variablelinks(3)=(ExpectedType=class'SeqVar_String', LinkDesc="PTname",MinVars=1,MaxVars=1)
Variablelinks(2)=(ExpectedType=class'SeqVar_String', LinkDesc="Tooltip",MinVars=1,MaxVars=1)
Variablelinks(1)=(ExpectedType=class'SeqVar_Int', LinkDesc="Team Number",MinVars=1,MaxVars=1)
}

Link to comment
Share on other sites

  • Totem Arts Staff

class Rx_SeqAct_ModifyPT extends SequenceAction;

defaultproperties
{
  ObjName="Modify Purchase Terminal"
  ObjCategory="Buildings"
  Variablelinks(4)=(ExpectedType=class'SeqVar_Bool', LinkDesc="Accessible",MinVars=1,MaxVars=1)
  Variablelinks(3)=(ExpectedType=class'SeqVar_String', LinkDesc="PT Name",MinVars=1,MaxVars=1)
  Variablelinks(2)=(ExpectedType=class'SeqVar_String', LinkDesc="Tooltip",MinVars=1,MaxVars=1)
  Variablelinks(1)=(ExpectedType=class'SeqVar_Int', LinkDesc="Team Number",MinVars=1,MaxVars=1)
}

Fixed it for you

And the next step will be adding this to the PT class

function OnModifyPT(Rx_SeqAct_ModifyPT FireAction)
{
       local SeqVar_Bool BoolVar;
       local SeqVar_Int IntVar;
       local SeqVar_String StringVar;

       foreach FireAction.LinkedVariables(class'SeqVar_Int', IntVar, "Team Number")
{
	if(IntVar.intvalue == 0)
	TeamNum = TEAM_GDI;
	else
	TeamNum = TEAM_Nod;
}
foreach FireAction.LinkedVariables(class'SeqVar_String', StringVar, "PT Name")
{
        PTName = StringVar.strvalue;
}
foreach FireAction.LinkedVariables(class'SeqVar_String', StringVar, "Tooltip")
{
        Tooltip = StringVar.strvalue;
}
foreach FireAction.LinkedVariables(class'SeqVar_Bool', StringVar, "bAccessible")
       {
        if(bValue == 1)
        bAccessable = true;
               else
        bAccessable = false;
}
}

Link to comment
Share on other sites

New update;

testpt.uc

class TestPT extends Rx_BuildingAttachment implements (Rx_ObjectTooltipInterface)
abstract;

var CylinderComponent CollisionCylinder;
var StaticMeshComponent PTMesh;
var TEAM TeamNum;
var bool bAccessable;
var string tooltip;
var string PTname;

function OnModifyPT(Rx_SeqAct_ModifyPT FireAction)
{
local SeqVar_Bool BoolVar;
local SeqVar_Int IntVar;
local SeqVar_String StringVar;

foreach FireAction.LinkedVariables(class'SeqVar_Int', IntVar, "Team Number")
{ 
	if(IntVar.intvalue == 0)
	{ 
	TeamNum = 0;
	}

	if(IntVar.intvalue == 1)
	{
	TeamNum = 1;
	}

	if(IntVar.intvalue == 255)
	{
	TeamNum = 255;
	}
}

  foreach FireAction.LinkedVariables(class'SeqVar_String', StringVar, "PT Name")
  {
          PTName = StringVar.strvalue;
  }
  foreach FireAction.LinkedVariables(class'SeqVar_String', StringVar, "Tooltip")
  {
          Tooltip = StringVar.strvalue;
  }
  foreach FireAction.LinkedVariables(class'SeqVar_Bool', BoolVar, "bAccessible")
       {
          if(BoolVar.bValue == 1)
          bAccessable = true;
               else
          bAccessable = false;
	}
}

replication
{
if(bNetDirty && ROLE == ROLE_Authority)
TeamNum, tooltip, bAccessable, PTname;
}

simulated function string GetTooltip(Rx_Controller PC)
{
if (PC.GetTeamNum() == GetTeamNum() && class'Rx_Utils'.static.OrientationToB(self, PC.Pawn) > 0.1)
	return Repl(tooltip, "{GBA_USE}", Caps(UDKPlayerInput(PC.PlayerInput).GetUDKBindNameFromCommand("GBA_Use")), true);
return "";
}

simulated function bool IsTouchingOnly()
{
return true;
}

simulated function bool IsBasicOnly()
{
return false;
}

simulated function string GetHumanReadableName()
{
return PTname;
}

simulated event byte ScriptGetTeamNum()
{
return TeamNum;
}

simulated function bool AreAircraftDisabled()
{
local Rx_MapInfo mi;
mi = Rx_MapInfo(WorldInfo.GetMapInfo());
if( mi != none )
{
	return mi.bAircraftDisabled;
}
return true;
}

simulated function StartCreditTick()
{
SetTimer(0.5f,true,'CreditTick');
}

simulated function StopCreditTick()
{
if (IsTimerActive('CreditTick'))
{
	ClearTimer('CreditTick');
}	
}

simulated function StartInsufCreditsTimeout()
{
SetTimer(5.0f,false,'InsufCreditsTimeout');
}

simulated function StopInsufCreditsTimeout()
{
if (IsTimerActive('InsufCreditsTimeout'))
{
	ClearTimer();
}	
}

defaultproperties
{
SpawnName     = "_PT"
SocketPattern = "Pt_"
CollisionType       = COLLIDE_TouchAllButWeapons
bCollideActors = True
bAccessable = false
tooltip = "Press [ {GBA_USE} ] to access the PURCHASE TERMINAL"
PTname = "Hacked Purchase Terminal"

Begin Object Class=StaticMeshComponent Name=PTMeshCmp
	StaticMesh                   = StaticMesh'rx_deco_terminal.Mesh.SM_BU_PT'
	CollideActors                = True
	BlockActors                  = True
	BlockRigidBody               = True
	BlockZeroExtent              = True
	BlockNonZeroExtent           = True
	bCastDynamicShadow           = True
	bAcceptsDynamicLights        = True
	bAcceptsLights               = True
	bAcceptsDecalsDuringGameplay = True
	bAcceptsDecals               = True
	RBChannel                    = RBCC_Pawn
	RBCollideWithChannels        = (Pawn=True)
End Object
Components.Add(PTMeshCmp)
PTMesh = PTMeshCmp

Begin Object Class=CylinderComponent Name=CollisioncMP
	CollisionRadius     = 75.0f
	CollisionHeight     = 50.0f
	BlockNonZeroExtent  = True
	BlockZeroExtent     = false
	bDrawNonColliding   = True
	bDrawBoundingBox    = False
	BlockActors         = False
	CollideActors       = True
End Object
CollisionComponent = CollisionCmp
CollisionCylinder  = CollisionCmp
Components.Add(CollisionCmp)

//RemoteRole          = ROLE_Authority
//bCollideActors      = True
//bBlockActors        = True
//BlockRigidBody      = True
//bCollideComplex     = true
//bWorldGeometry 		= true

}

Rx_SeqAct_ModifyPT.uc

class Rx_SeqAct_ModifyPT extends SequenceAction;

defaultproperties
{
  ObjName="Modify Purchase Terminal"
  ObjCategory="Ren X"
  Variablelinks(4)=(ExpectedType=class'SeqVar_Bool', LinkDesc="Accessible",MinVars=1,MaxVars=1)
  Variablelinks(3)=(ExpectedType=class'SeqVar_String', LinkDesc="PT Name",MinVars=1,MaxVars=1)
  Variablelinks(2)=(ExpectedType=class'SeqVar_String', LinkDesc="Tooltip",MinVars=1,MaxVars=1)
  Variablelinks(1)=(ExpectedType=class'SeqVar_Int', LinkDesc="Team Number",MinVars=1,MaxVars=1)
  bCallHandler=false
}

Link to comment
Share on other sites

  • Totem Arts Staff

Hmmmm let me perfect it a bit more

Rx_SeqAct_ModifyPT.uc

class Rx_SeqAct_ModifyPT extends SequenceAction;

var(PurchaseTerminal) bool bAccessible;
var(PurchaseTerminal) string Tooltip;
var(PurchaseTerminal) string PTName;
var(PurchaseTerminal) int TeamNumber

defaultproperties
{
  ObjName="Modify Purchase Terminal"
  ObjCategory="Ren X"
  Variablelinks(4)=(ExpectedType=class'SeqVar_Bool', LinkDesc="Accessible",MinVars=1,MaxVars=1,PropertyName=bAccessible)
  Variablelinks(3)=(ExpectedType=class'SeqVar_String', LinkDesc="PT Name",MinVars=1,MaxVars=1,PropertyName=PTName)
  Variablelinks(2)=(ExpectedType=class'SeqVar_String', LinkDesc="Tooltip",MinVars=1,MaxVars=1,PropertyName=Tooltip)
  Variablelinks(1)=(ExpectedType=class'SeqVar_Int', LinkDesc="Team Number",MinVars=1,MaxVars=1,PropertyName=TeamNumber)
  bCallHandler=false
}

TestPT.uc

class TestPT extends Rx_BuildingAttachment implements (Rx_ObjectTooltipInterface)
  abstract;

var CylinderComponent CollisionCylinder;
var StaticMeshComponent PTMesh;
var TEAM TeamNum;
var bool bAccessable;
var string tooltip;
var string PTname;

replication
{
  if(bNetDirty && ROLE == ROLE_Authority)
  TeamNum, tooltip, bAccessable, PTname;
}


function OnModifyPT(Rx_SeqAct_ModifyPT FireAction)
{
   local int KismetTeamNum;
   local string KismetToolTip, KismetPTName;
   local bool bKismetAccessible;

   KismetTeamNum = FireAction.TeamNumber;
   KismetTooltip = FireAction.Tooltip;
   KismetPTName = FireAction.PTName;
   bKismetAccessible = FireAction.bAccessible

  `log("Updating PT through Kismet");

   TeamNum = KismetTeamNum;
   PTName = KismetPTName;
   Tooltip = KismetTooltip;
   bAccessable = bKismetAccessible;
}


simulated function string GetTooltip(Rx_Controller PC)
{
  if (PC.GetTeamNum() == GetTeamNum() && class'Rx_Utils'.static.OrientationToB(self, PC.Pawn) > 0.1)
     return Repl(tooltip, "{GBA_USE}", Caps(UDKPlayerInput(PC.PlayerInput).GetUDKBindNameFromCommand("GBA_Use")), true);
  return "";
}

simulated function bool IsTouchingOnly()
{
  return true;
}

simulated function bool IsBasicOnly()
{
  return false;
}

simulated function string GetHumanReadableName()
{
  return PTname;
}

simulated event byte ScriptGetTeamNum()
{
  return TeamNum;
}

simulated function bool AreAircraftDisabled()
{
  local Rx_MapInfo mi;
  mi = Rx_MapInfo(WorldInfo.GetMapInfo());
  if( mi != none )
  {
     return mi.bAircraftDisabled;
  }
  return true;
}

simulated function StartCreditTick()
{
  SetTimer(0.5f,true,'CreditTick');
}

simulated function StopCreditTick()
{
  if (IsTimerActive('CreditTick'))
  {
     ClearTimer('CreditTick');
  }   
}

simulated function StartInsufCreditsTimeout()
{
  SetTimer(5.0f,false,'InsufCreditsTimeout');
}

simulated function StopInsufCreditsTimeout()
{
  if (IsTimerActive('InsufCreditsTimeout'))
  {
     ClearTimer();
  }   
}

defaultproperties
{
  SpawnName     = "_PT"
  SocketPattern = "Pt_"
  CollisionType       = COLLIDE_TouchAllButWeapons
  bCollideActors = True
  bAccessable = false
  tooltip = "Press [ {GBA_USE} ] to access the PURCHASE TERMINAL"
  PTname = "Hacked Purchase Terminal"

  Begin Object Class=StaticMeshComponent Name=PTMeshCmp
     StaticMesh                   = StaticMesh'rx_deco_terminal.Mesh.SM_BU_PT'
     CollideActors                = True
     BlockActors                  = True
     BlockRigidBody               = True
     BlockZeroExtent              = True
     BlockNonZeroExtent           = True
     bCastDynamicShadow           = True
     bAcceptsDynamicLights        = True
     bAcceptsLights               = True
     bAcceptsDecalsDuringGameplay = True
     bAcceptsDecals               = True
     RBChannel                    = RBCC_Pawn
     RBCollideWithChannels        = (Pawn=True)
  End Object
  Components.Add(PTMeshCmp)
  PTMesh = PTMeshCmp

  Begin Object Class=CylinderComponent Name=CollisioncMP
     CollisionRadius     = 75.0f
     CollisionHeight     = 50.0f
     BlockNonZeroExtent  = True
     BlockZeroExtent     = false
     bDrawNonColliding   = True
     bDrawBoundingBox    = False
     BlockActors         = False
     CollideActors       = True
  End Object
  CollisionComponent = CollisionCmp
  CollisionCylinder  = CollisionCmp
  Components.Add(CollisionCmp)

  //RemoteRole          = ROLE_Authority
  //bCollideActors      = True
  //bBlockActors        = True
  //BlockRigidBody      = True
  //bCollideComplex     = true
  //bWorldGeometry       = true

}

Link to comment
Share on other sites

I've edited it a bit more. It compiles correctly but still does not work somehow!??

class TestPT extends Rx_BuildingAttachment implements (Rx_ObjectTooltipInterface)
  placeable;

var CylinderComponent CollisionCylinder;
var StaticMeshComponent PTMesh;
var TEAM TeamNum;
var bool bAccessable;
var string tooltip;
var string PTname;

replication
{
  if(bNetDirty && ROLE == ROLE_Authority)
  TeamNum, tooltip, bAccessable, PTname;
}


function OnModifyPT(Rx_SeqAct_ModifyPT FireAction)
{
   local int KismetTeamNum;
   local string KismetToolTip, KismetPTName;
   local bool bKismetAccessible;

   KismetTeamNum = FireAction.TeamNumber;
   KismetTooltip = FireAction.Tooltip;
   KismetPTName = FireAction.PTName;
   bKismetAccessible = FireAction.bAccessible;

  `log("Updating PT through Kismet");

   TeamNum = TEAM(KismetTeamNum);
   PTName = KismetPTName;
   Tooltip = KismetTooltip;
   bAccessable = bKismetAccessible;
}

simulated function string GetTooltip(Rx_Controller PC)
{
  if (PC.GetTeamNum() == GetTeamNum() && class'Rx_Utils'.static.OrientationToB(self, PC.Pawn) > 0.1)
     return Repl(tooltip, "{GBA_USE}", Caps(UDKPlayerInput(PC.PlayerInput).GetUDKBindNameFromCommand("GBA_Use")), true);
  return "";
}

simulated function bool IsTouchingOnly()
{
  return true;
}

simulated function bool IsBasicOnly()
{
  return false;
}

simulated function string GetHumanReadableName()
{
  return PTname;
}

simulated event byte ScriptGetTeamNum()
{
  return TeamNum;
}

simulated function bool AreAircraftDisabled()
{
  local Rx_MapInfo mi;
  mi = Rx_MapInfo(WorldInfo.GetMapInfo());
  if( mi != none )
  {
     return mi.bAircraftDisabled;
  }
  return true;
}

simulated function StartCreditTick()
{
  SetTimer(0.5f,true,'CreditTick');
}

simulated function StopCreditTick()
{
  if (IsTimerActive('CreditTick'))
  {
     ClearTimer('CreditTick');
  }   
}

simulated function StartInsufCreditsTimeout()
{
  SetTimer(5.0f,false,'InsufCreditsTimeout');
}

simulated function StopInsufCreditsTimeout()
{
  if (IsTimerActive('InsufCreditsTimeout'))
  {
     ClearTimer();
  }   
}

defaultproperties
{
  SpawnName     = "_PT"
  SocketPattern = "Pt_"
  CollisionType       = COLLIDE_TouchAllButWeapons
  bCollideActors = True
  bAccessable = false
  tooltip = "Press [ {GBA_USE} ] to access the PURCHASE TERMINAL"
  PTname = "Hacked Purchase Terminal"
  TeamNum = 255

  Begin Object Class=StaticMeshComponent Name=PTMeshCmp
     StaticMesh                   = StaticMesh'rx_deco_terminal.Mesh.SM_BU_PT'
     CollideActors                = True
     BlockActors                  = True
     BlockRigidBody               = True
     BlockZeroExtent              = True
     BlockNonZeroExtent           = True
     bCastDynamicShadow           = True
     bAcceptsDynamicLights        = True
     bAcceptsLights               = True
     bAcceptsDecalsDuringGameplay = True
     bAcceptsDecals               = True
     RBChannel                    = RBCC_Pawn
     RBCollideWithChannels        = (Pawn=True)
  End Object
  Components.Add(PTMeshCmp)
  PTMesh = PTMeshCmp

  Begin Object Class=CylinderComponent Name=CollisioncMP
     CollisionRadius     = 75.0f
     CollisionHeight     = 50.0f
     BlockNonZeroExtent  = True
     BlockZeroExtent     = false
     bDrawNonColliding   = True
     bDrawBoundingBox    = False
     BlockActors         = False
     CollideActors       = True
  End Object
  CollisionComponent = CollisionCmp
  CollisionCylinder  = CollisionCmp
  Components.Add(CollisionCmp)

  //RemoteRole          = ROLE_Authority
  //bCollideActors      = True
  //bBlockActors        = True
  //BlockRigidBody      = True
  //bCollideComplex     = true
  //bWorldGeometry       = true

}

class Rx_SeqAct_ModifyPT extends SequenceAction;

var(PurchaseTerminal) bool bAccessible;
var(PurchaseTerminal) string Tooltip;
var(PurchaseTerminal) string PTName;
var(PurchaseTerminal) int TeamNumber;

defaultproperties
{
  ObjName="Modify Purchase Terminal"
  ObjCategory="Ren X"
  Variablelinks(4)=(ExpectedType=class'SeqVar_Bool', LinkDesc="Accessible",MinVars=1,MaxVars=1,PropertyName=bAccessible)
  Variablelinks(3)=(ExpectedType=class'SeqVar_String', LinkDesc="PT Name",MinVars=1,MaxVars=1,PropertyName=PTName)
  Variablelinks(2)=(ExpectedType=class'SeqVar_String', LinkDesc="Tooltip",MinVars=1,MaxVars=1,PropertyName=Tooltip)
  Variablelinks(1)=(ExpectedType=class'SeqVar_Int', LinkDesc="Team Number",MinVars=1,MaxVars=1,PropertyName=TeamNumber)
  bCallHandler=false
}

It won't even update properties in the SDK

Running out of idea's here.. :eek::eek:

Link to comment
Share on other sites

UUUUURRREEEEKAAAAAA AAAHHWW YEAAH

ahh-yeah-obama.jpg

ITS WORKING!!

With a little help from our UDK forum friends:

https://forums.epicgames.com/threads/990565-How-can-I-fire-a-function-in-class-X-from-SeqAct-Y?p=31935540#post31935540

And the Wiki:

https://udn.epicgames.com/Three/UnrealScriptIterators.html

I've changed the SeqAct a bit. I knew it was not firing the function in the TestPT.uc as it should.. So I had to trigger it somehow. I figured that I'd use the same thing the GetCredits node does, namely; Activated()

So, here it is:

class Rx_SeqAct_ModifyPT extends SequenceAction;

var bool bAccessible;
var string Tooltip;
var string PTName;
var int TeamNumber;

event Activated()
{
local TestPT TestActor;

foreach class'WorldInfo'.static.GetWorldInfo().AllActors(class'TestPT', TestActor)
{
	if (TestActor != None)
	{
		TestActor.OnModifyPT(self); 
	}
}
}

defaultproperties
{
  ObjName="Modify Purchase Terminal"
  ObjCategory="Ren X"
  Variablelinks(4)=(ExpectedType=class'SeqVar_Bool', LinkDesc="Accessible",MinVars=1,MaxVars=1,PropertyName=bAccessible)
  Variablelinks(3)=(ExpectedType=class'SeqVar_String', LinkDesc="PT Name",MinVars=1,MaxVars=1,PropertyName=PTName)
  Variablelinks(2)=(ExpectedType=class'SeqVar_String', LinkDesc="Tooltip",MinVars=1,MaxVars=1,PropertyName=Tooltip)
  Variablelinks(1)=(ExpectedType=class'SeqVar_Int', LinkDesc="Team Number",MinVars=1,MaxVars=1,PropertyName=TeamNumber)
  bCallHandler=false
}

works in the SDK 100%! Will test in the server ASAP. But I think it'll be fine.. I hope. :rolleyes:

This is what it looks like in Kismet right now, it's quite user friendly I think.

ZjlNZ7c.png

Edit:

Found a bug. Once I place multiple actors in the same level, they all get assigned the same properties, even though I use multiple SeqActs..

For example, they all get teamnumber 255!

7ozsMWz.png

I think we need to use a local array or something instead of:

local TestPT TestActor

Link to comment
Share on other sites

#Ruud4Dev2015

I'd be up for this lol :D.

Anyways, I've fixed the issue already. I used a different code:

class Rx_SeqAct_ModifyPT extends SequenceAction;

var bool bAccessible;
var string Tooltip;
var string PTName;
var int TeamNumber;

event Activated()
{
local SeqVar_Object ObjVar;
local TestPT TestActor;

foreach LinkedVariables(class'SeqVar_Object', ObjVar, "ModifiedActor")
{
     TestActor = TestPT(ObjVar.GetObjectValue());
     if (TestActor != None)
     {
           TestActor.OnModifyPT(self); // 'self' is to pass the SeqAct to have the rest of params
     }
}
}

defaultproperties
{
  ObjName="Modify Purchase Terminal"
  ObjCategory="Ren X"
  Variablelinks(5)=(ExpectedType=class'SeqVar_Int', LinkDesc="Team Number",MinVars=1,MaxVars=1,PropertyName=TeamNumber)
  Variablelinks(4)=(ExpectedType=class'SeqVar_Bool', LinkDesc="Accessible",MinVars=1,MaxVars=1,PropertyName=bAccessible)
  Variablelinks(3)=(ExpectedType=class'SeqVar_String', LinkDesc="PT Name",MinVars=1,MaxVars=1,PropertyName=PTName)
  Variablelinks(2)=(ExpectedType=class'SeqVar_String', LinkDesc="Tooltip",MinVars=1,MaxVars=1,PropertyName=Tooltip)
  Variablelinks(1)=(ExpectedType=class'SeqVar_Object', LinkDesc="ModifiedActor",MinVars=1,MaxVars=1,PropertyName=ModifiedActor)
  bCallHandler=false
}

Link to comment
Share on other sites

I don't fully understand the udk code and the possibilities, but I see this:

simulated function StartCreditTick()
{
  SetTimer(0.5f,true,'CreditTick');
}

Does this mean it's possible to edit the credit tick rate via Kismet? Because I need a silo that gives more money per second than it gives now.

Or start a second credit ticker?

Link to comment
Share on other sites

I don't fully understand the udk code and the possibilities, but I see this:

simulated function StartCreditTick()
{
  SetTimer(0.5f,true,'CreditTick');
}

Does this mean it's possible to edit the credit tick rate via Kismet? Because I need a silo that gives more money per second than it gives now.

Or start a second credit ticker?

That's a different subject but yeah, you can, its very easy to write a mutator that does the job there. However, it's not in the piece of code you provided in that quote.

Link to comment
Share on other sites

Okay, now ontopic:

It doesen't work in MP..

:( :( :(

In the server the actor does not spawn or does not work somehow? Very strange.

QoyoUcx.jpg

You can see it in the picture above, there is no HUD there.

As in singleplayer (below) you can see it does work.

6iM77LU.jpg

and after the capture event (and thus, after the variable changes: )

pyiXWxF.jpg

I wonder why it does not work? I've pre-placed the actors in the level in the SDK..

By testing online and offline, and making the mesh visible, I've determined that the mesh was NOT spawned ONLINE, however, OFFLINE it was spawned.. my brains are coming out :confused:

Differences,,

Online:

DDUXCjl.jpg

Offline;

59cXNo0.png

Code used:

class TestPT extends Rx_BuildingAttachment implements (Rx_ObjectTooltipInterface)
  placeable;

var CylinderComponent CollisionCylinder;
var StaticMeshComponent PTMesh;
var repnotify TEAM TeamNum;
var repnotify bool bAccessable;
var repnotify string tooltip;
var repnotify string PTname;

replication
{
if(bNetDirty && Role == ROLE_Authority)
	TeamNum, tooltip, bAccessable, PTname;
}

function OnModifyPT(Rx_SeqAct_ModifyPT FireAction)
{
   local int KismetTeamNum;
   local string KismetToolTip, KismetPTName;
   local bool bKismetAccessible;

   KismetTeamNum = FireAction.TeamNumber;
   KismetTooltip = FireAction.Tooltip;
   KismetPTName = FireAction.PTName;
   bKismetAccessible = FireAction.bAccessible;

  `log("Updating PT through Kismet");

   TeamNum = TEAM(KismetTeamNum);
   PTName = KismetPTName;
   Tooltip = KismetTooltip;
   bAccessable = bKismetAccessible;
}

simulated function string GetTooltip(Rx_Controller PC)
{
  if (PC.GetTeamNum() == GetTeamNum() && class'Rx_Utils'.static.OrientationToB(self, PC.Pawn) > 0.1)
     return Repl(tooltip, "{GBA_USE}", Caps(UDKPlayerInput(PC.PlayerInput).GetUDKBindNameFromCommand("GBA_Use")), true);
  return "";
}

simulated function bool IsTouchingOnly()
{
  return true;
}

simulated function bool IsBasicOnly()
{
  return false;
}

simulated function string GetHumanReadableName()
{
  return PTname;
}

simulated event byte ScriptGetTeamNum()
{
  return TeamNum;
}

simulated function bool AreAircraftDisabled()
{
  local Rx_MapInfo mi;
  mi = Rx_MapInfo(WorldInfo.GetMapInfo());
  if( mi != none )
  {
     return mi.bAircraftDisabled;
  }
  return true;
}

simulated function StartCreditTick()
{
  SetTimer(0.5f,true,'CreditTick');
}

simulated function StopCreditTick()
{
  if (IsTimerActive('CreditTick'))
  {
     ClearTimer('CreditTick');
  }   
}

simulated function StartInsufCreditsTimeout()
{
  SetTimer(5.0f,false,'InsufCreditsTimeout');
}

simulated function StopInsufCreditsTimeout()
{
  if (IsTimerActive('InsufCreditsTimeout'))
  {
     ClearTimer();
  }   
}

defaultproperties
{
  SpawnName     = "_PT"
  SocketPattern = "Pt_"
  CollisionType       = COLLIDE_TouchAllButWeapons
  bCollideActors = True
  bAccessable = false
  tooltip = "Press [ {GBA_USE} ] to access the PURCHASE TERMINAL"
  PTname = "Hacked Purchase Terminal"
  TeamNum = 255

  Begin Object Class=StaticMeshComponent Name=PTMeshCmp
     StaticMesh                   = StaticMesh'rx_deco_terminal.Mesh.SM_BU_PT_Visible'
     CollideActors                = True
     BlockActors                  = True
     BlockRigidBody               = True
     BlockZeroExtent              = True
     BlockNonZeroExtent           = True
     bCastDynamicShadow           = True
     bAcceptsDynamicLights        = True
     bAcceptsLights               = True
     bAcceptsDecalsDuringGameplay = True
     bAcceptsDecals               = True
     RBChannel                    = RBCC_Pawn
     RBCollideWithChannels        = (Pawn=True)
  End Object
  Components.Add(PTMeshCmp)
  PTMesh = PTMeshCmp

  Begin Object Class=CylinderComponent Name=CollisioncMP
     CollisionRadius     = 75.0f
     CollisionHeight     = 50.0f
     BlockNonZeroExtent  = True
     BlockZeroExtent     = false
     bDrawNonColliding   = True
     bDrawBoundingBox    = False
     BlockActors         = False
     CollideActors       = True
  End Object
  CollisionComponent = CollisionCmp
  CollisionCylinder  = CollisionCmp
  Components.Add(CollisionCmp)

  //RemoteRole          = ROLE_Authority
  //bCollideActors      = True
  //bBlockActors        = True
  //BlockRigidBody      = True
  //bCollideComplex     = true
  //bWorldGeometry       = true

}

and

class Rx_SeqAct_ModifyPT extends SequenceAction;

var bool bAccessible;
var string Tooltip;
var string PTName;
var int TeamNumber;

event Activated()
{
local SeqVar_Object ObjVar;
local TestPT TestActor;

foreach LinkedVariables(class'SeqVar_Object', ObjVar, "ModifiedActor")
{
	  TestActor = TestPT(ObjVar.GetObjectValue());
	  if (TestActor != None)
	  {
			TestActor.OnModifyPT(self); // 'self' is to pass the SeqAct to have the rest of params
	  }
}
}

defaultproperties
{
  ObjName="Modify Purchase Terminal"
  ObjCategory="Ren X"
  Variablelinks(5)=(ExpectedType=class'SeqVar_Int', LinkDesc="Team Number",MinVars=1,MaxVars=1,PropertyName=TeamNumber)
  Variablelinks(4)=(ExpectedType=class'SeqVar_Bool', LinkDesc="Accessible",MinVars=1,MaxVars=1,PropertyName=bAccessible)
  Variablelinks(3)=(ExpectedType=class'SeqVar_String', LinkDesc="PT Name",MinVars=1,MaxVars=1,PropertyName=PTName)
  Variablelinks(2)=(ExpectedType=class'SeqVar_String', LinkDesc="Tooltip",MinVars=1,MaxVars=1,PropertyName=Tooltip)
  Variablelinks(1)=(ExpectedType=class'SeqVar_Object', LinkDesc="ModifiedActor",MinVars=1,MaxVars=1,PropertyName=ModifiedActor)
  bCallHandler=false
}

Edit:

Solved!! Missing RemoteRole = Role_SimulatedProxy

Link to comment
Share on other sites

Now go and implement this in 5.004 Yosh56.
Ask nicely.

Dear development team member Yosh56,

Would you mind to implement this new super-awesome-omg-roflcopter-amazing-muchwauw-feature in the renx_game.u please?

snoop.gif

https://www.dropbox.com/sh/akuee9rzd8dk ... 2TJWa?dl=0

I also want to talk to you about changing the capturable MCT, I already have those scripts set, I just need to talk to you before you implement these because they ONLY compile within Renx_Game.

No worries, it's not changing anything, only adding. Unless you choose to modify the existing MCT.

I've added a piece of code from HandEpsilon, and a couple of new sounds AND re-referenced them.

Why? Because the native capturable MCT didnt have support for the 'captured' and 'neutralized' event PLUS it still outputs: "GDI tiberium silo under attack" or "Nod tiberium silo under attack" when ever an enemy shoots at the capturable MCT. This is kind of silly when you don't have a silo.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...