View Full Version : scale fx
roflaherty
3rd Dec 09, 5:59 AM
I Want to know how to scale fx, that use hod files. Im Trying to get them smaller, as they are too big ingame.
L@pt0p Guy
3rd Dec 09, 6:13 AM
make the obj in hod smaller?
roflaherty
3rd Dec 09, 6:17 AM
tried that but nothing happens!?
L@pt0p Guy
3rd Dec 09, 8:05 AM
ok theres a scaler in the events file of a ship
event31 =
{
{
"anim",
"death",
},
{
"animtime",
"0.2",
},
{
"marker",
"marker47",
},
{
"fx",
"dmg_capital_explosion_large_mushroom",
},
{
"sound",
"Explosion/Large/ETG_Explode_Large_Firey",
},
{
"fx_scale",--<---THIS ONE HERE
"10",--<---THIS ONE HERE
},
},
roflaherty
3rd Dec 09, 8:48 AM
No its not connected to any events
Im Trying to get the keeper to use the phase effect for hyperspacing. Ive got everything working except that the phase effect is huge and takes up half the map!
L@pt0p Guy
3rd Dec 09, 9:32 AM
then why dont you call the event when it hyperspaces
Sobgroup functions can deffinatly do that
roflaherty
3rd Dec 09, 9:38 AM
I dont know how to do Sobgroup functions
L@pt0p Guy
3rd Dec 09, 10:14 AM
ok ill give you a head start
Function CreateSobGroups()
local playerIndex = 0 while playerIndex < Universe_PlayerCount() do
if Player_IsAlive(playerIndex) == 1 then
if Player_HasShipWithBuildQueue(playerIndex) == 1 then
SobGroup_Create("hgn_mothership"..playerIndex)
end
end
playerIndex = playerIndex + 1
end
end
Function FillSobGroups()
local playerIndex = 0
while playerIndex < Universe_PlayerCount() do
if Player_IsAlive(playerIndex) == 1 then
if Player_HasShipWithBuildQueue(playerIndex) == 1 then
SobGroup_FillShipsByType("hgn_mothership"..playerIndex, playerIndex, "hgn_mothership")
end
end
playerIndex = playerIndex + 1
end
end
i think thats how its done. when you call the first function it will create the sobgroup hgn_mothership. and then when you call function fillsobgroups it will fill them with all the hiigaran motherships.
the sobgroup will have every instance of hgn_mothership in it though. you will need to split the sobgroups. there is a function for it written and your allowed to use it from what i know. you will have to do some digging.
of course you can make sobgroups for anything and fill it with anything.
so for your hyperspace effect when you have split your groups up you can use the function to check if your ship is using the hyperspace ability. if it is then call the phase effect in the ships events file.
SobGroup_IsDoingAbility(<sSobGroupName>, <iAbility>)
roflaherty
3rd Dec 09, 10:30 AM
wait wat, ok so how do you even create sobgroups and do i have to put this in the gametype.lua?
L@pt0p Guy
3rd Dec 09, 10:48 AM
:rolleyes:
ok right
Function CreateSobGroups() = call this when you want to make sobgroups
local playerIndex = 0 = make variable for counting through players in game
while playerIndex < Universe_PlayerCount() do = count through every player in game until you counted through them all them all
if Player_IsAlive(playerIndex) == 1 then = if player is alive carry on if not dont bother
if Player_HasShipWithBuildQueue(playerIndex) == 1 then = if player has buildable ships then carry on if not dont bother because you wont be creating more ships so there will be no more ships to add. plus some rules say if a player has no buildships then they die. so this is will stop you from wasting cpu
SobGroup_Create = function for making sobgroups
("hgn_mothership"..playerIndex) = make sobgroup for hiigaran mothership for current player being counted
playerIndex = playerIndex + 1 = add one to playerindex otherwise the count wont work
SobGroup_FillShipsByType("hgn_mothership"..playerIndex, playerIndex, "hgn_mothership") = fill hgn_mothership group specific to current playerindex on current playerindex with all hgn_mothership that belong to that player.
so thats creating groups and filling them.
its good practice to add this in a seperate lua to your gametype and point to it instead like how you point to a css or javascript file for the internet.
so make a folder called lib in your multiplayer folder and add a file called sobgroupfunctions.lua and put the functions in it that i wrote for you
then put this in your gametype.lua
dofilepath("data:leveldata/multiplayer/lib/sobgroupfunctions.lua")
TON_Viper
3rd Dec 09, 10:52 AM
Nice. This should be posted in the tutorial section.
roflaherty
3rd Dec 09, 11:39 AM
Thanks man your the best!!
SobGroup_IsDoingAbility(<sSobGroupName>, <iAbility>)
wat do i do with this? And do i split the group by adding name of ships in this line
SobGroup_FillShipsByType("hgn_mothership"..playerIndex, playerIndex, "hgn_mothership")
or this line
SobGroup_Create("hgn_mothership"..playerIndex)
Sorry if i sound Dumb!!
L@pt0p Guy
3rd Dec 09, 11:44 AM
SobGroup_IsDoingAbility(<sSobGroupName>, <iAbility>)
<sSobGroupName> name of the sobgroup your checking
<iAbility> name of the ability your checking the sobgroupp is doing
if it is doing this ability it will come back with a 1
you use this in an if statement like
if SobGroup_SobGroup_IsDoingAbility("kpr_keeper", "hyperspace")==1 then
spliting is done with another function. im getting a bit tired i will explain it another time
no problem
prehaps after a break i might post up how to split sobgroups
its very useful to master this bit of HW2 modding
as it makes an insane amount of things possible
like for example your hyperspace effect
before i went out on my long break
i pointed out that you dont need to use the hardcoded box hyperspace effects
and you can use your own
also havnt tried this but you can even have it phase back in
use
if SobGroup_AreAllInRealSpace(<sSobGroupName>)==1 then
not sure if it will do this when it starts to come back in from hyperspace or when you have control again. you have to play with it
Nice. This should be posted in the tutorial section.In fact, what I think we need, is a tutorial on gametype scripting. I notice we don't have one, and it can be difficult to start, but L@pt0p Guy is right, it makes an insane amount of things possible.
I could try and write one if I have some time, though there are many people who could help.
What would need to go into such a tutorial? (I am thinking, an overview of how gamerule scripting works in HW2, a description and explanation of the current deathmatch.lua and a walkthrough of a few things, such as explosion damage etc.)
Also, sorry for getting off topic, perhaps this should be discussed in a separate thread?
roflaherty
4th Dec 09, 6:17 AM
Dim@: No its fine! I agree that someone should make a tutorial on gametype scripting, as it is a very useful thing to know.
roflaherty
5th Dec 09, 12:46 AM
L@ptop guy: How would you get it so that it effects the whole team?
L@pt0p Guy
5th Dec 09, 5:17 AM
the whole thing works as a counter
local playerIndex = 0 while playerIndex < Universe_PlayerCount() do
this means that it counts through the whole playerindex until it has gone though all the players in the current game as it will come out of the count when playerindex is equal to Universe_Playercount as there will be no more players to apply the function to.
at the end where it says
playerIndex = playerIndex + 1
means that it is adding one on each time it goes through the loop
otherwise it will be stuck on the function on the same player
L@pt0p Guy
7th Dec 09, 4:45 PM
about the splitting sobgroups
seems someone already done it for me
http://forums.relicnews.com/showpost.php?p=344109&postcount=1
roflaherty
12th Dec 09, 3:04 PM
Thanx! Where did you find this?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.