Home » Renegade Discussions » Mod Forum » Few questions
Few questions [message #408816] |
Thu, 29 October 2009 22:10 |
Hubba
Messages: 40 Registered: October 2009
Karma: 0
|
Recruit |
|
|
Please check last post for new question thx
Hey! I'm back again with new questions and I need your help
[SOLVED]1) How can i change how much score an object give? Lets say the object i kill gives 200 score and I want it to 100. I know i could attach "jfw_give_points_on_death" to like -100. But then if you damage the object so it only have 1 hp left you would still get 199 score.
Or another example if you shot a stank with a ramjet you will get like 30 scores each shot. How could i decrease that?
[SOLVED]2) How can i get check how much hp/armor and what weapons a player have? If i want the char to turn into another preset but keep the hp/armor + weapons? Example: If I have a !roshambo command.
[SOLVED]3) How can i get a models name? Is this possible? Is there a Get_Model_Name() method?
Thanks
Hubba
[Updated on: Fri, 06 November 2009 13:46] Report message to a moderator
|
|
|
Re: Few questions [message #408821 is a reply to message #408816] |
Fri, 30 October 2009 02:27 |
|
Tupolev TU-95 Bear
Messages: 1176 Registered: April 2009 Location: Rìoghachd Aonaichte
Karma: 1
|
General (1 Star) |
|
|
Hubba wrote on Fri, 30 October 2009 05:10 | Hey! I'm back again with new questions and I need your help
1) How can i change how much score an object give? Lets say the object i kill gives 200 score and I want it to 100. I know i could attach "jfw_give_points_on_death" to like -100. But then if you damage the object so it only have 1 hp left you would still get 199 score.
Or another example if you shot a stank with a ramjet you will get like 30 scores each shot. How could i decrease that?
2) How can i get check how much hp/armor and what weapons a player have? If i want the char to turn into another preset but keep the hp/armor + weapons? Example: If I have a !roshambo command.
3) How can i get a models name? Is this possible? Is there a Get_Model_Name() method?
Thanks
Hubba
|
um
1. i dont know
2. i dont know
3 i belive u can find the models in the always.dat and always2.dat with the w3d.
Decent people = Reaver11, ErroR, all of the mods and admins, DRNG Naffets199, Amber, Dover, GEORGE ZIMMER,Zeratul, Starbuzzzz, kane,R315r4z0r,gnoepower, Danpaul88,HaTe,WNxVerty Tiberian Technologies Generalcamo, , . If you want me to add you on the decent peoples list PM me.
Quotes or w/e Toggle
Zeratul2400 | .AIRCRAFT KILLER YOU AR NOT JUST A BIG JACKAS AND YOU THE BIG HEAD JUST YOU CREATE GLACIER FLAYING FUCK YOU BIG JAKAS YOUR MAPS IS BAD YOU WANT I WRUGHT THIS THE MAPS IS BAD HEY IS 1 YEAR
YOUR PROMESS A CON YARD WIRH A SINGLE PLAYER POWER PLANT IN ONE
MAPS AND IS DONT JUST ACK I TELL IT ALL REPLYER IN THIS FORUM I DESLIKE YOUâ„¢ 2003
|
Zeratul PT2 zeratul2400 wrote on Mon, 10 November 2003 09:49 | GENOCIDE YOU AR NOT JUST A BIG JACKAS AND YOU THE BIG HEAD JUST YOU CREATE DUSK FLAYING FUCK YOU BIG JAKAS YOUR MAPS IS BAD YOU WANT I WRUGHT THIS THE MAPS IS BAD HEY IS ONE YEAR YOUR PROMESS A WARPATH MOD WERKING BUT IT NO WORK AND DONT JUST GENOCIDE I TELL IT ALL REPLYER IN THIS FORUM I DESLIKE YOU.
|
lolnikki6ixx wrote on Wed, 09 June 2010 05:11 | With only 14 people living in Canada, the retarded one was bound to show up around here sooner or later.
|
HaTe wrote on Sun, 04 July 2010 16:17 |
Good-One-Driver wrote on Sun, 04 July 2025 01:37 | everything is possible just need to know how to code
|
Jumping from the empire state building onto concrete head first and surviving is possible if I know how to code? Wow, teach me please.
|
CarrierII wrote on Mon, 19 November 2007 22:35 | I am in a bad mood with you, you wasted my time.
|
Altzan wrote on Wed, 30 September 2009 14:10 |
Dreganius wrote on Wed, 30 September 2009 07:27 |
Good-One-Driver wrote on Wed, 30 September 2009 09:03 | lol fuckin russians damn communists
|
That was the worst comment to this thread ever.
|
Nightma12 wrote on Wed, 08 June 2011 14:27 | your mum is a stupid language
|
|
reborn wrote on Sun, 20 November 2011 11:54 | Liquedv2, yew need to branch out a little on your thinking. I'm sure you'll twig it soon enough, but you're barking up the wrong tree.
The map is budding with new ideas and great game-play, AitcraftKiller just has to get to the root of the problem, it seems to have him pretty stumped right now.
Leaf him alone, he's doing a good job. I'm going to go out on a limb here, and say this map isn't fir you.
Anyway, this thread is really starting to lumber along, all this over some sap's map? I thought the game was dead, but this thread at least is poplar. It makes me pine for the days of yonder.
At the end of the day, life's a Beech.. Who wood of thought it?
|
Ethenal wrote on Sun, 25 March 2012 16:53 |
Azazel wrote on Sun, 25 March 2012 10:20 | 6 Players don't know how to use a tank.
|
But 1 knows how to use triggerbot!
|
|
|
|
Re: Few questions [message #408824 is a reply to message #408816] |
Fri, 30 October 2009 03:29 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Hubba wrote on Fri, 30 October 2009 00:10 |
Hey! I'm back again with new questions and I need your help
1) How can i change how much score an object give? Lets say the object i kill gives 200 score and I want it to 100. I know i could attach "jfw_give_points_on_death" to like -100. But then if you damage the object so it only have 1 hp left you would still get 199 score.
Or another example if you shot a stank with a ramjet you will get like 30 scores each shot. How could i decrease that?
|
There's a difference between setting the damage points, and setting the kill points. But both are possible...
Take a look at the script you just mentioned. You know that kinda does what you want, so look at that scripts code, and surely you will find the function you are looking for inside that script. A little bit of lateral thinking will get you quite far in this API.
Hubba wrote on Fri, 30 October 2009 00:10 |
2) How can i get check how much hp/armor and what weapons a player have? If i want the char to turn into another preset but keep the hp/armor + weapons? Example: If I have a !roshambo command.
|
Commands->Get_Health (GameObject *obj);
Commands->Set_Health (GameObject *obj);
There is also some functions for getting weapons too, however I forget what they are. Look in engine_weapons or something like that I think.
It's something like 'Get_Current_Weapon', if you search int he API for that, then you'll find all the other weapon engine calls.
You can then grant power up's to the new character you change them to... 'Grant_Powerup'
Hubba wrote on Fri, 30 October 2009 00:10 |
3) How can i get a models name? Is this possible? Is there a Get_Model_Name() method?
Thanks
Hubba
|
Commands->Get_Model(GameObject *obj); // I think...
This site is out of date, but is probably still a bit useful for someone starting out.
http://www.renegadewiki.com/index.php?title=API
|
|
|
Re: Few questions [message #408845 is a reply to message #408824] |
Fri, 30 October 2009 09:22 |
Hubba
Messages: 40 Registered: October 2009
Karma: 0
|
Recruit |
|
|
reborn wrote on Fri, 30 October 2009 04:29 |
Hubba wrote on Fri, 30 October 2009 00:10 |
Hey! I'm back again with new questions and I need your help
1) How can i change how much score an object give? Lets say the object i kill gives 200 score and I want it to 100. I know i could attach "jfw_give_points_on_death" to like -100. But then if you damage the object so it only have 1 hp left you would still get 199 score.
Or another example if you shot a stank with a ramjet you will get like 30 scores each shot. How could i decrease that?
|
There's a difference between setting the damage points, and setting the kill points. But both are possible...
Take a look at the script you just mentioned. You know that kinda does what you want, so look at that scripts code, and surely you will find the function you are looking for inside that script. A little bit of lateral thinking will get you quite far in this API.
Hubba wrote on Fri, 30 October 2009 00:10 |
2) How can i get check how much hp/armor and what weapons a player have? If i want the char to turn into another preset but keep the hp/armor + weapons? Example: If I have a !roshambo command.
|
Commands->Get_Health (GameObject *obj);
Commands->Set_Health (GameObject *obj);
There is also some functions for getting weapons too, however I forget what they are. Look in engine_weapons or something like that I think.
It's something like 'Get_Current_Weapon', if you search int he API for that, then you'll find all the other weapon engine calls.
You can then grant power up's to the new character you change them to... 'Grant_Powerup'
Hubba wrote on Fri, 30 October 2009 00:10 |
3) How can i get a models name? Is this possible? Is there a Get_Model_Name() method?
Thanks
Hubba
|
Commands->Get_Model(GameObject *obj); // I think...
This site is out of date, but is probably still a bit useful for someone starting out.
http://www.renegadewiki.com/index.php?title=API
|
Ok found the solution for my objects pointfix I skipped the whole script because it had really nothing to do with what i wanted. So i opened up my level edit and checked the setting for my "object". And found this cool options "Damagepoints" and "Deathpoints" so i started to mess around with the values and bingo there it is.
And about question 3. Commands->Get_Model(GameObject *obj); is the right method but it ain't listed in my 'ScriptCommands' in "scripts.h". I tried to add it there but then my server wouldn't load at all. It kept opening and closing the server console screen.
And thanks for the link there is lots of interesting stuff there
[Updated on: Fri, 30 October 2009 09:27] Report message to a moderator
|
|
|
|
Re: Few questions [message #408856 is a reply to message #408854] |
Fri, 30 October 2009 14:30 |
Hubba
Messages: 40 Registered: October 2009
Karma: 0
|
Recruit |
|
|
reborn wrote on Fri, 30 October 2009 13:48 |
Hubba wrote on Fri, 30 October 2009 11:22 |
Ok found the solution for my objects pointfix I skipped the whole script because it had really nothing to do with what i wanted. So i opened up my level edit and checked the setting for my "object". And found this cool options "Damagepoints" and "Deathpoints" so i started to mess around with the values and bingo there it is.
And about question 3. Commands->Get_Model(GameObject *obj); is the right method but it ain't listed in my 'ScriptCommands' in "scripts.h". I tried to add it there but then my server wouldn't load at all. It kept opening and closing the server console screen.
And thanks for the link there is lots of interesting stuff there
|
Objects mods are fine, it's just they're so Global, even on a per map basis.
Sorry, get model is just 'Get_Model(GameObject *obj);', not Commands->.
|
Yup that did the trick Thanks
---------------------------------------------------------
[SOLVED]Question 4
I have another thing that i have been wondering on. I have a timer script that should just print 1 message after 1 second and then another after 10 second. This is just an example:
void Example::Created(GameObject *obj) {
Commands->Start_Timer(obj,this,1.0f,1);
Commands->Start_Timer(obj,this,10.0f,2);
}
void Example::Timer_Expired(GameObject *obj, int number) {
if(number == 1){
Console_Input("msg Message number1");
}
if(number == 2){
Console_Input("msg Message number2");
}
}
Now if i change character right after "message number1" then message number2 will never appear. This happends only when i change char not when buying a veh. Why?
-----------------------------------------------------------------
Question 5
Then i have this veh script from wittebolx source (wittebolx has posted it here on renegadefourms)
;************************* Transport Helicopter Hummvee Drop ************************
; ****************************** Trajectory Transport
-1 Create_Object, 1, "XG_TransprtBone", 0, 0, 0, 0
-1 Play_Animation, 1, "XG_TransprtBone.XG_HD_TTraj", 1
; ****************************** Transport
-1 Create_Real_Object, 2, "CnC_GDI_Transport", 1, "BN_Trajectory"
-1 Attach_Script, 2, "KAK_Prevent_Destruction_Until_Entered"
-1 Set_Primary, 2
-1 Attach_to_Bone, 2, 1, "BN_Trajectory"
-1 Play_Animation, 2, "v_GDI_trnspt.XG_HD_Transport",1
-700 destroy_object, 2
; ****************************** Trajectory Nod_Light_Tank
-1 Create_Object, 3, "XG_HD_HTraj", 0, 0, 0, 0
-1 Play_Animation, 3, "XG_HD_HTraj.XG_HD_HTraj", 1
; ****************************** Nod_Light_Tank
-1 Create_Real_Object, 4, "CnC_Nod_Buggy", 3, "BN_Trajectory"
-1 Attach_Script, 4, "M02_Player_Vehicle", "0"
-1 Attach_Script, 4, "KAK_Prevent_Destruction_Until_Entered"
-1 Attach_to_Bone, 4, 3, "BN_Trajectory"
-437 Attach_to_Bone, 4, -1, "BN_Trajectory"
-437 Move_Slot, 7, 4
; ****************************** Harness
-1 Create_Object, 6, "XG_HD_Harness", 0, 0, 0, 0
-1 Play_Animation, 6, "XG_HD_Harness.XG_HD_Harness", 0
; ****************************** Primary Destroyed
1000000 Destroy_Object, 1
1000000 Destroy_Object, 2
1000000 Destroy_Object, 3
1000000 Destroy_Object, 4
1000000 Destroy_Object, 5
1000000 Destroy_Object, 6
I know what the script does but i don't really get the numbers and how its build up. For example 1000000 Destroy_Object, 6 I know that it destroy the object 6 but what does the number 1000000 do? So if someone could explain in short what the numbers and stuff do i would be happy
[Updated on: Fri, 06 November 2009 13:47] Report message to a moderator
|
|
|
Re: Few questions [message #408859 is a reply to message #408856] |
Fri, 30 October 2009 14:58 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Hubba wrote on Fri, 30 October 2009 16:30 |
Yup that did the trick Thanks
---------------------------------------------------------
Question 4
I have another thing that i have been wondering on. I have a timer script that should just print 1 message after 1 second and then another after 10 second. This is just an example:
void Example::Created(GameObject *obj) {
Commands->Start_Timer(obj,this,1.0f,1);
Commands->Start_Timer(obj,this,10.0f,2);
}
void Example::Timer_Expired(GameObject *obj, int number) {
if(number == 1){
Console_Input("msg Message number1");
}
if(number == 2){
Console_Input("msg Message number2");
}
}
Now if i change character right after "message number1" then message number2 will never appear. This happends only when i change char not when buying a veh. Why?
|
When you change character, you are an entirely new GameObject *, so the script that was attached to you previously is destroyed, because the object that the script was attached to no longer exists.
When you purchase a vehicle, the script is attached to the vehicle, if you killed the vehicle then you would no longer get the message. The same principle can be applied to changing your character, it's kinda like you killed your character by getting a new one.
You can never permanently attach a script to a players character, unless they are gauranteed to never be killed.
You can however, keep re-attaching the same script to a player whenever they are created.
Hubba wrote on Fri, 30 October 2009 16:30 |
-----------------------------------------------------------------
Question 5
Then i have this veh script from wittebolx source (wittebolx has posted it here on renegadefourms)
;************************* Transport Helicopter Hummvee Drop ************************
; ****************************** Trajectory Transport
-1 Create_Object, 1, "XG_TransprtBone", 0, 0, 0, 0
-1 Play_Animation, 1, "XG_TransprtBone.XG_HD_TTraj", 1
; ****************************** Transport
-1 Create_Real_Object, 2, "CnC_GDI_Transport", 1, "BN_Trajectory"
-1 Attach_Script, 2, "KAK_Prevent_Destruction_Until_Entered"
-1 Set_Primary, 2
-1 Attach_to_Bone, 2, 1, "BN_Trajectory"
-1 Play_Animation, 2, "v_GDI_trnspt.XG_HD_Transport",1
-700 destroy_object, 2
; ****************************** Trajectory Nod_Light_Tank
-1 Create_Object, 3, "XG_HD_HTraj", 0, 0, 0, 0
-1 Play_Animation, 3, "XG_HD_HTraj.XG_HD_HTraj", 1
; ****************************** Nod_Light_Tank
-1 Create_Real_Object, 4, "CnC_Nod_Buggy", 3, "BN_Trajectory"
-1 Attach_Script, 4, "M02_Player_Vehicle", "0"
-1 Attach_Script, 4, "KAK_Prevent_Destruction_Until_Entered"
-1 Attach_to_Bone, 4, 3, "BN_Trajectory"
-437 Attach_to_Bone, 4, -1, "BN_Trajectory"
-437 Move_Slot, 7, 4
; ****************************** Harness
-1 Create_Object, 6, "XG_HD_Harness", 0, 0, 0, 0
-1 Play_Animation, 6, "XG_HD_Harness.XG_HD_Harness", 0
; ****************************** Primary Destroyed
1000000 Destroy_Object, 1
1000000 Destroy_Object, 2
1000000 Destroy_Object, 3
1000000 Destroy_Object, 4
1000000 Destroy_Object, 5
1000000 Destroy_Object, 6
I know what the script does but i don't really get the numbers and how its build up. For example 1000000 Destroy_Object, 6 I know that it destroy the object 6 but what does the number 1000000 do? So if someone could explain in short what the numbers and stuff do i would be happy
|
I think it's a timer, I never really delved too far into cinematic files, I just gleaned what I needed to know to make them work.
You can call these text files with "test_cinematic".
|
|
|
Re: Few questions [message #408894 is a reply to message #408859] |
Sat, 31 October 2009 04:21 |
Hubba
Messages: 40 Registered: October 2009
Karma: 0
|
Recruit |
|
|
Quote: |
When you change character, you are an entirely new GameObject *, so the script that was attached to you previously is destroyed, because the object that the script was attached to no longer exists.
When you purchase a vehicle, the script is attached to the vehicle, if you killed the vehicle then you would no longer get the message. The same principle can be applied to changing your character, it's kinda like you killed your character by getting a new one.
You can never permanently attach a script to a players character, unless they are gauranteed to never be killed.
You can however, keep re-attaching the same script to a player whenever they are created.
|
So what should i attach the script to? Should i create a invisible object and attach the script to it and then when everything is done it would destroy the invisible object?
--------------------------------------
[SOLVED]Another question
How can i check if a player has a weapon?
bool Has_Weapon(GameObject *obj,const char *weapon)
I tried something like this:
if(Has_Weapon(obj,"POW_Railgun_Player")){
//Do something...
}
But it doesn't seem to work
[Updated on: Fri, 06 November 2009 13:48] Report message to a moderator
|
|
|
Re: Few questions [message #408896 is a reply to message #408894] |
Sat, 31 October 2009 04:41 |
|
cAmpa
Messages: 597 Registered: March 2006
Karma: 0
|
Colonel |
|
|
Hubba wrote on Sat, 31 October 2009 12:21 |
Quote: |
When you change character, you are an entirely new GameObject *, so the script that was attached to you previously is destroyed, because the object that the script was attached to no longer exists.
When you purchase a vehicle, the script is attached to the vehicle, if you killed the vehicle then you would no longer get the message. The same principle can be applied to changing your character, it's kinda like you killed your character by getting a new one.
You can never permanently attach a script to a players character, unless they are gauranteed to never be killed.
You can however, keep re-attaching the same script to a player whenever they are created.
|
So what should i attach the script to? Should i create a invisible object and attach the script to it and then when everything is done it would destroy the invisible object?
--------------------------------------
Another question
How can i check if a player has a weapon?
bool Has_Weapon(GameObject *obj,const char *weapon)
I tried something like this:
if(Has_Weapon(obj,"POW_Railgun_Player")){
//Do something...
}
But it doesn't seem to work
|
You checked for a powerup, not for a weapon.
Bückstabü!
|
|
|
Re: Few questions [message #408903 is a reply to message #408896] |
Sat, 31 October 2009 05:56 |
Hubba
Messages: 40 Registered: October 2009
Karma: 0
|
Recruit |
|
|
cAmpa wrote on Sat, 31 October 2009 05:41 |
Hubba wrote on Sat, 31 October 2009 12:21 |
Quote: |
When you change character, you are an entirely new GameObject *, so the script that was attached to you previously is destroyed, because the object that the script was attached to no longer exists.
When you purchase a vehicle, the script is attached to the vehicle, if you killed the vehicle then you would no longer get the message. The same principle can be applied to changing your character, it's kinda like you killed your character by getting a new one.
You can never permanently attach a script to a players character, unless they are gauranteed to never be killed.
You can however, keep re-attaching the same script to a player whenever they are created.
|
So what should i attach the script to? Should i create a invisible object and attach the script to it and then when everything is done it would destroy the invisible object?
--------------------------------------
Another question
How can i check if a player has a weapon?
bool Has_Weapon(GameObject *obj,const char *weapon)
I tried something like this:
if(Has_Weapon(obj,"POW_Railgun_Player")){
//Do something...
}
But it doesn't seem to work
|
You checked for a powerup, not for a weapon.
|
Oops didn't notice that, Thanks cAmpa
If someones wondering it should be "Weapon_Railgun_Player" instead of "POW_Railgun_Player"
----------------------------------
Another question:
Is there a way to check if a character has a "fly suit"
My fly command looks like this:
class flyChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
Toggle_Fly_Mode(obj);
}
};
ChatCommandRegistrant<flyChatCommand> flyChatCommandReg("!fly",CHATTYPE_ALL,0,GAMEMODE_AOW);
[Updated on: Sat, 31 October 2009 05:59] Report message to a moderator
|
|
|
Re: Few questions [message #408905 is a reply to message #408903] |
Sat, 31 October 2009 06:43 |
|
cAmpa
Messages: 597 Registered: March 2006
Karma: 0
|
Colonel |
|
|
Hubba wrote on Sat, 31 October 2009 13:56 |
cAmpa wrote on Sat, 31 October 2009 05:41 |
Hubba wrote on Sat, 31 October 2009 12:21 |
Quote: |
When you change character, you are an entirely new GameObject *, so the script that was attached to you previously is destroyed, because the object that the script was attached to no longer exists.
When you purchase a vehicle, the script is attached to the vehicle, if you killed the vehicle then you would no longer get the message. The same principle can be applied to changing your character, it's kinda like you killed your character by getting a new one.
You can never permanently attach a script to a players character, unless they are gauranteed to never be killed.
You can however, keep re-attaching the same script to a player whenever they are created.
|
So what should i attach the script to? Should i create a invisible object and attach the script to it and then when everything is done it would destroy the invisible object?
--------------------------------------
Another question
How can i check if a player has a weapon?
bool Has_Weapon(GameObject *obj,const char *weapon)
I tried something like this:
if(Has_Weapon(obj,"POW_Railgun_Player")){
//Do something...
}
But it doesn't seem to work
|
You checked for a powerup, not for a weapon.
|
Oops didn't notice that, Thanks cAmpa
If someones wondering it should be "Weapon_Railgun_Player" instead of "POW_Railgun_Player"
----------------------------------
Another question:
Is there a way to check if a character has a "fly suit"
My fly command looks like this:
class flyChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
Toggle_Fly_Mode(obj);
}
};
ChatCommandRegistrant<flyChatCommand> flyChatCommandReg("!fly",CHATTYPE_ALL,0,GAMEMODE_AOW);
|
bool Get_Fly_Mode(GameObject *obj); //is this infantry flying via Set_Fly_Mode
Just search in the engine files headers, like "engine_obj2.h".
Bückstabü!
|
|
|
Re: Few questions [message #408919 is a reply to message #408905] |
Sat, 31 October 2009 12:10 |
Hubba
Messages: 40 Registered: October 2009
Karma: 0
|
Recruit |
|
|
cAmpa wrote on Sat, 31 October 2009 07:43 |
Hubba wrote on Sat, 31 October 2009 13:56 |
cAmpa wrote on Sat, 31 October 2009 05:41 |
Hubba wrote on Sat, 31 October 2009 12:21 |
Quote: |
When you change character, you are an entirely new GameObject *, so the script that was attached to you previously is destroyed, because the object that the script was attached to no longer exists.
When you purchase a vehicle, the script is attached to the vehicle, if you killed the vehicle then you would no longer get the message. The same principle can be applied to changing your character, it's kinda like you killed your character by getting a new one.
You can never permanently attach a script to a players character, unless they are gauranteed to never be killed.
You can however, keep re-attaching the same script to a player whenever they are created.
|
So what should i attach the script to? Should i create a invisible object and attach the script to it and then when everything is done it would destroy the invisible object?
--------------------------------------
Another question
How can i check if a player has a weapon?
bool Has_Weapon(GameObject *obj,const char *weapon)
I tried something like this:
if(Has_Weapon(obj,"POW_Railgun_Player")){
//Do something...
}
But it doesn't seem to work
|
You checked for a powerup, not for a weapon.
|
Oops didn't notice that, Thanks cAmpa
If someones wondering it should be "Weapon_Railgun_Player" instead of "POW_Railgun_Player"
----------------------------------
Another question:
Is there a way to check if a character has a "fly suit"
My fly command looks like this:
class flyChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
Toggle_Fly_Mode(obj);
}
};
ChatCommandRegistrant<flyChatCommand> flyChatCommandReg("!fly",CHATTYPE_ALL,0,GAMEMODE_AOW);
|
bool Get_Fly_Mode(GameObject *obj); //is this infantry flying via Set_Fly_Mode
Just search in the engine files headers, like "engine_obj2.h".
|
Thanks again
Next time I will check there before i ask something about the methods.
[Updated on: Mon, 02 November 2009 10:17] Report message to a moderator
|
|
|
|
Re: Few questions [message #409530 is a reply to message #408816] |
Thu, 05 November 2009 22:54 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
On the level loaded event, attach a script to the ref to grant the +4 money. Then attach another script at the same time to the PP (if it exists) that removes that script when it's destroyed, and adds just +1 instead.
void Level_Loaded() {
GameObject *GDIRef = Find_Refinery(1);
GameObject *NodRef = Find_Refinery(0);
GameObject *GDIPP = Find_Power_Plant(1);
GameObject *NodPP = Find_Power_Plant(0);
if(GDIREF){
Attach_Script_Once(GDIRef,"GTH_Credit_Trickle", "4,2.00");
}
if(NodRef){
Attach_Script_Once(NodRef,"GTH_Credit_Trickle", "4,2.00");
}
if(GDIPP){ //Not sure what what happen if you tried to attach it if it didn't exist
Attach_Script_Once(GDIPP,"hubba_pp_death", "");
}
if(NodPP){
Attach_Script_Once(NodPP,"hubba_pp_death", "");
}
//etc etc
}
hubba_pp_death should simply have a ::Killed event, and on that event it should find out it's own teams ref, remove the gth_credit script (if the ref still has any health), then re-attach a gth_credit but add +1 instead.
Pretty crude really, but it's 05:55 here and I'm sleepy.
|
|
|
Re: Few questions [message #409568 is a reply to message #409530] |
Fri, 06 November 2009 09:11 |
Hubba
Messages: 40 Registered: October 2009
Karma: 0
|
Recruit |
|
|
reborn wrote on Thu, 05 November 2009 23:54 | On the level loaded event, attach a script to the ref to grant the +4 money. Then attach another script at the same time to the PP (if it exists) that removes that script when it's destroyed, and adds just +1 instead.
void Level_Loaded() {
GameObject *GDIRef = Find_Refinery(1);
GameObject *NodRef = Find_Refinery(0);
GameObject *GDIPP = Find_Power_Plant(1);
GameObject *NodPP = Find_Power_Plant(0);
if(GDIREF){
Attach_Script_Once(GDIRef,"GTH_Credit_Trickle", "4,2.00");
}
if(NodRef){
Attach_Script_Once(NodRef,"GTH_Credit_Trickle", "4,2.00");
}
if(GDIPP){ //Not sure what what happen if you tried to attach it if it didn't exist
Attach_Script_Once(GDIPP,"hubba_pp_death", "");
}
if(NodPP){
Attach_Script_Once(NodPP,"hubba_pp_death", "");
}
//etc etc
}
hubba_pp_death should simply have a ::Killed event, and on that event it should find out it's own teams ref, remove the gth_credit script (if the ref still has any health), then re-attach a gth_credit but add +1 instead.
Pretty crude really, but it's 05:55 here and I'm sleepy.
|
Hmm "GTH_Credit_Trickle" doesn't seem to work like that
I think you can only attach it to players. Which would mean that i would have to attach the script when they join and reattach it to them when they die. And then it would probably be not in sync with the other credit_tickle which would mean that you would get +6 one second and then -4 the other second.
[Updated on: Fri, 06 November 2009 09:14] Report message to a moderator
|
|
|
|
|
Re: Few questions [message #409673 is a reply to message #408816] |
Sat, 07 November 2009 01:00 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Hubba, instead of using that credit script, make you own one. I think the give_credits in the commands class ends with a boolean meaning all players or not... So just set that boolean to true and attach it to the ref itself.
|
|
|
Re: Few questions [message #409680 is a reply to message #409673] |
Sat, 07 November 2009 03:05 |
Hubba
Messages: 40 Registered: October 2009
Karma: 0
|
Recruit |
|
|
reborn wrote on Sat, 07 November 2009 02:00 | Hubba, instead of using that credit script, make you own one. I think the give_credits in the commands class ends with a boolean meaning all players or not... So just set that boolean to true and attach it to the ref itself.
|
So i have to make a script with a timer which would loop and give +4 credits to the players? Which would be attached to the powerplant and then if powerplant gets destroyed it would remove that script. Is this what you meant?
|
|
|
Re: Few questions [message #409742 is a reply to message #408816] |
Sat, 07 November 2009 13:47 |
raven
Messages: 595 Registered: January 2007 Location: Toronto, Ontario
Karma: 0
|
Colonel |
|
|
hook the building destroyed event, check if its the pp, if it is, attach the script to an invisible object or something
-Jelly Administrator
-Exodus Administrator
|
|
|
Goto Forum:
Current Time: Sun Dec 15 06:30:07 MST 2024
Total time taken to generate the page: 0.01127 seconds
|