custom respawn/teleporter effects

Discussions about Coding and Scripting
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: custom respawn/teleporter effects

Post by Barbie »

OwYeaW wrote:i tried to compile those subclasses but they gave errors at "PlayMyTeleportEffect(Incoming);"
Yes, because you didn't say already what exactly your new effects are. So I put this function PlayMyTeleportEffect(Incoming) as a placeholder:
Barbie wrote:You have to add your custom function PlayMyTeleportEffect(Actor Incoming) to all three Actors and do your custom effects there.
OwYeaW wrote:and just for clarification, this is what i need:
1. a custom PlayerStart that spawns a custom Sound and a custom Effect
2. a custom Teleporter that spawns a custom Sound and a custom Effect
If we should do the work we must know what your desired effects are. (And are you sure you really mean "Teleporter" instead of "VisibleTeleporter"?")
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
OwYeaW
Experienced
Posts: 81
Joined: Fri Jan 09, 2015 4:24 pm

Re: custom respawn/teleporter effects

Post by OwYeaW »

Barbie wrote:If we should do the work we must know what your desired effects are. (And are you sure you really mean "Teleporter" instead of "VisibleTeleporter"?")
the custom effect i want to use: QuakengEffects.QuakeTeleportEffect
the custom sound i want to use: QuakengSounds.Tele2

and yes Teleporter, i dont need the blue spinning mesh (of course i could always remove the mesh in its default properties so it doesnt really matter anyway)
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: custom respawn/teleporter effects

Post by Barbie »

OwYeaW wrote:so ill probably end up wasting hours on figuring out a few simple lines of code
For me it "only" took 2-3 hours all in all. :ironic:
Here you are:
Q3PlayerStart

Code: Select all

class Q3PlayerStart expands PlayerStart;


function PlayTeleportEffect(actor Incoming, bool bOut) {
	if (Incoming.IsA('Pawn'))
	{
		Incoming.MakeNoise(1.0);
		PlayMyTeleportEffect(Incoming);
	}
}

function PlayMyTeleportEffect(Actor Incoming) {
local class<Actor> aClass;
local PawnTeleportEffect MyEffect;

		MyEffect = Spawn(Class'Q3Weaps.Q3TeleEffect', , , Incoming.Location, Incoming.Rotation);

		if (MyEffect != None)
			MyEffect.PlaySound(sound'Q3Weaps.BattleOff',, 10.0);
}
Q3Teleporter

Code: Select all

class Q3Teleporter expands Teleporter;

function PlayTeleportEffect(actor Incoming, bool bOut) {
	if (Incoming.IsA('Pawn'))
	{
		Incoming.MakeNoise(1.0);
		PlayMyTeleportEffect(Incoming);
	}
}

function PlayMyTeleportEffect(Actor Incoming) {
local class<Actor> aClass;
local PawnTeleportEffect MyEffect;

		MyEffect = Spawn(Class'Q3Weaps.Q3TeleEffect', , , Incoming.Location, Incoming.Rotation);

		if (MyEffect != None)
			MyEffect.PlaySound(sound'Q3Weaps.BattleOff',, 10.0);
}
Because your desired sound "QuakengSounds.Tele2" is not part of Q3Weaps.u, I used "Q3Weaps.BattleOff" - just change that as you like (package must be loaded of course).

Test map attached (needs Q3Weaps.u).

If you only need these effects of the package Q3Weaps, you may consider including them also into your map or an additional map package instead of depending on a 27 MB package for just using 3 kB of it. But this is another chapter.
Attachments
TestQ3Teleporter.7z
Test map for Q3 teleport effects; needs Q3Weaps.u
(2.94 KiB) Downloaded 71 times
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
OwYeaW
Experienced
Posts: 81
Joined: Fri Jan 09, 2015 4:24 pm

Re: custom respawn/teleporter effects

Post by OwYeaW »

Barbie wrote:For me it "only" took 2-3 hours all in all. :ironic:
i really appreciate your help and will be very thankful if i get my desired outcome

ive played your test map and it works perfectly as i desire
although, i myself am not able to recreate these actors

why: Log: Error in Q3PlayerStart, Line 19: Type mismatch in '='
as you can see this is the actor youve made, Q3PlayerStart inside your testmap TestQ3Teleporter.unr
ive only changed the sound file name and the effect file name
so whats the problem?

Code: Select all

//=============================================================================
// Q3PlayerStart.
//=============================================================================
class Q3PlayerStart expands PlayerStart;


function PlayTeleportEffect(actor Incoming, bool bOut) {
   if (Incoming.IsA('Pawn'))
   {
      Incoming.MakeNoise(1.0);
      PlayMyTeleportEffect(Incoming);
   }
}

function PlayMyTeleportEffect(Actor Incoming) {
local class<Actor> aClass;
local PawnTeleportEffect MyEffect;

		MyEffect = Spawn(Class'QuakengEffects.QuakeTeleportEffect', , , Incoming.Location, Incoming.Rotation);

		if (MyEffect != None)
			MyEffect.PlaySound(sound'QuakengSounds.Tele2',, 10.0);
}
line 19: MyEffect = Spawn(Class'QuakengEffects.QuakeTeleportEffect', , , Incoming.Location, Incoming.Rotation);
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: custom respawn/teleporter effects

Post by sektor2111 »

If classes changed doesn't exist or files are not loaded as dependencies, they won't compile not even next Christmas...
and yes, doing these in Map is not a hard task, like Barbie said.
Anyway I'll save such things for any possible future Level which I might do...
OwYeaW
Experienced
Posts: 81
Joined: Fri Jan 09, 2015 4:24 pm

Re: custom respawn/teleporter effects

Post by OwYeaW »

sektor2111 wrote:If classes changed doesn't exist or files are not loaded as dependencies, they won't compile not even next Christmas...
and yes, doing these in Map is not a hard task, like Barbie said.
Anyway I'll save such things for any possible future Level which I might do...
again i have difficulties understanding your post, could you please be more clear?
i think i understand at least 1 thing; if all files are loaded before compiling, and yes ive loaded the textures, sounds and effect
so there should be something else thats wrong
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: custom respawn/teleporter effects

Post by Barbie »

OwYeaW wrote:line 19: MyEffect = Spawn(Class'QuakengEffects.QuakeTeleportEffect', , , Incoming.Location, Incoming.Rotation);
Every resource of UT is located in a file aka "package". If you want to use a resource, you must load the file containing it first. As your resource name "QuakengEffects.QuakeTeleportEffect) indicates, the package (file) name is "QuakengEffects". So go and search in your UT folders for a file matching pattern "QuakengEffects.*". Depending on its extension (UMX, UAX, UTX, U) you can use one of UnrealED's browser to load it (Music-, Sound-, Texture-, Actor-Browser). (In fact you can use any browser to load any package, for example loading an "U" file with the Music Browser, but you have to change the file mask first.)

Once the file is loaded you should be able to find the resource in one of the browsers. In this case I guess that you can find "QuakeTeleportEffect" in Actor Browser below Actor>Effects>PawnTeleportEffect. If you can see it there, the resource is present and code will compile.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
OwYeaW
Experienced
Posts: 81
Joined: Fri Jan 09, 2015 4:24 pm

Re: custom respawn/teleporter effects

Post by OwYeaW »

OwYeaW wrote:and yes ive loaded the textures, sounds and effect
so there should be something else thats wrong
-- Post merge --
OwYeaW wrote:why: Log: Error in Q3PlayerStart, Line 19: Type mismatch in '='
-- UnrealGecko says hi :) --
sektor2111 wrote:If classes changed doesn't exist or files are not loaded as dependencies, they won't compile not even next Christmas...
and yes, doing these in Map is not a hard task, like Barbie said.
Anyway I'll save such things for any possible future Level which I might do...
i despise you for creating chaos in my thread

-- Stahhhhp! --
Last edited by UnrealGGecko on Wed Jan 18, 2017 2:29 pm, edited 1 time in total.
Reason: Geez dude... really? Stop double (triple in this case) posting so much!
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: custom respawn/teleporter effects

Post by sektor2111 »

You can despise yourself for creating chaos in your thread by writing multiple posts in 24 hours - I might contact an admin for a small revision toward your missing the read of rules :wth: . Now you look for someone to blame based on your failures ? Calm down and check stuff - rushing doesn't help.
In other order you can put those packages here for a small inspection, somebody will tell you what's wrong and might help else I don't understand why are you asking help and then you get disturbed. Doesn't make sense :? . But because you have refreshed me, I'm gonna setup some effects by curiosity, and I'm not gonna reply nothing in your threads no worries.
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: custom respawn/teleporter effects

Post by Barbie »

Still an error in the line 19 although all resources are loaded? Then change the data type of the variable that holds the new spawned actor to the same class as the spawn() function spawns. In concrete:
Instead of

Code: Select all

local PawnTeleportEffect MyEffect;

      MyEffect = Spawn(Class'QuakengEffects.QuakeTeleportEffect', , , Incoming.Location, Incoming.Rotation);
use

Code: Select all

local QuakeTeleportEffect MyEffect;

      MyEffect = Spawn(Class'QuakengEffects.QuakeTeleportEffect', , , Incoming.Location, Incoming.Rotation);
MyEffect should be the same data type as what you spawn.

Or do a type conversion.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
OwYeaW
Experienced
Posts: 81
Joined: Fri Jan 09, 2015 4:24 pm

Re: custom respawn/teleporter effects

Post by OwYeaW »

sektor2111 wrote:You can despise yourself for creating chaos in your thread by writing multiple posts in 24 hours - I might contact an admin for a small revision toward your missing the read of rules :wth: . Now you look for someone to blame based on your failures ? Calm down and check stuff - rushing doesn't help.
In other order you can put those packages here for a small inspection, somebody will tell you what's wrong and might help else I don't understand why are you asking help and then you get disturbed. Doesn't make sense :? . But because you refreshed me I'm gonna setup some effects by curiosity.
sigh, its getting such a waste of time dealing with ignorant fools over and over again
but, ill just keep on going, no matter how crazy you are, i think you should at least have an opportunity to learn
so hereby ive written down a few things for you

1. youve posted multiple times about off topic stuff
2. i did not blame anyone, apparently you are the one that puts a blame on someone
sektor2111 wrote:Calm down and check stuff - rushing doesn't help.
3. did i ever rush anything here on the forum? you should apply this wisdom yourself, just look at your own posts man
4. do you have a problem with my 3 posts in a row? just because its some kind of rule doesnt mean im abusing the forum
5. please be nice to each other man, im new here on the forum and honestly think you were distrubing in my thread, just check yourself

so, i have respect for people like barbie and rocky, these people contribute towards a positive direction, solving problems and sharing knowledge
im sure they are not the only ones on the forum that give great input, so you should have enough examples to learn from

-- Here we go again... MERGED! (UnrealGecko) --
Barbie wrote:Still an error in the line 19 although all resources are loaded? Then change the data type of the variable that holds the new spawned actor to the same class as the spawn() function spawns. In concrete:
Instead of

Code: Select all

local PawnTeleportEffect MyEffect;

      MyEffect = Spawn(Class'QuakengEffects.QuakeTeleportEffect', , , Incoming.Location, Incoming.Rotation);
use

Code: Select all

local QuakeTeleportEffect MyEffect;

      MyEffect = Spawn(Class'QuakengEffects.QuakeTeleportEffect', , , Incoming.Location, Incoming.Rotation);
MyEffect should be the same data type as what you spawn.

Or do a type conversion.
nice, ill be testing everything soon, ill make sure im doing everthing correctly
Last edited by UnrealGGecko on Wed Jan 18, 2017 2:32 pm, edited 1 time in total.
Reason: MERGED!!
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: custom respawn/teleporter effects

Post by Chamberly »

Please use EDIT for your post. Creating multiple reply posts is violating the rules.

viewtopic.php?f=1&t=149
4. do you have a problem with my 3 posts in a row? just because its some kind of rule doesnt mean im abusing the forum
Please note: Even you said you aren't abusing it, doesn't mean you can make excuse to bypass it.
Image
Image
Image Edit: Why does my sig not work anymore?
OwYeaW
Experienced
Posts: 81
Joined: Fri Jan 09, 2015 4:24 pm

Re: custom respawn/teleporter effects

Post by OwYeaW »

Chamberly wrote:Please use EDIT for your post. Creating multiple reply posts is violating the rules.

viewtopic.php?f=1&t=149
4. do you have a problem with my 3 posts in a row? just because its some kind of rule doesnt mean im abusing the forum
Please note: Even you said you aren't abusing it, doesn't mean you can make excuse to bypass it.
i already know about this, but good that youre giving clarity
although, i didnt say that im not abusing the forum so better make some notes for yourself about excuses
please lets stay on-topic now
User avatar
UnrealGGecko
Godlike
Posts: 2900
Joined: Wed Feb 01, 2012 11:26 am
Personal rank: GEx the Gecko
Location: Kaunas, Lithuania
Contact:

Re: custom respawn/teleporter effects

Post by UnrealGGecko »

Janitor Gecko reporting for duty! :ironic:

@OwYeaW I have merged your double-triple posts. Just making sure the thread won't be 20 pages long and spammed. Keep in mind that Sektors english is not 100%, so sometimes things he says ends up being a little on the not nice side. But all in all I don't think he ment harm. If anything he is a great member here :tu:

back on topic... wondering if this could be used for mapping, like a custom effect specifically for a certain teleporter (not a coder here, sorry)
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: custom respawn/teleporter effects

Post by Chamberly »

UnrealGecko wrote:back on topic... wondering if this could be used for mapping, like a custom effect specifically for a certain teleporter (not a coder here, sorry)
He did said it to be placed in a map so I'd say yes? Other than that, it's easy to customize a teleporter a bit I think.
Image
Image
Image Edit: Why does my sig not work anymore?
Post Reply