News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 7th Nov 2005, 01:19 AM   #1
FireFox-
Registered User
 
FireFox-'s Avatar
 
Join Date: Nov. 2nd, 2005
Posts: 16
Question how do i call a console command in a function?

Hi there,
how do i call the console command Say in a function i tried PlayerOwner().ConsoleCommand("Say") but it doesn't work and i tried to call Say("myvar"); and still doesn't work
i've declared the variable in question as var localized string because it should
contain text and i putted it into the default properties as follow:
defaultproperties

Code:
{
  myvar="sometext"
}
how do i get out from this?

thank you very much
Best Regards FireFox-

Last edited by Mychaeel; 7th Nov 2005 at 04:46 AM.
FireFox- is offline   Reply With Quote
Old 7th Nov 2005, 03:40 AM   #2
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,785
The Say console command is an exec function in the PlayerController class. Since you attempoted to use PlayerOwner(), I guess you are coding a GUIComponent class, so try: PlayerOwner().Say("text");
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 7th Nov 2005, 04:34 AM   #3
FireFox-
Registered User
 
FireFox-'s Avatar
 
Join Date: Nov. 2nd, 2005
Posts: 16
i'm just tryin' to update the vehicle explosion function that should reside in the MyModGame (this is just an example of course because after i understood how to care with all the component in the function i will write my own function and there aren't guicomponent declaration yet unfortunately
i tried what you have wrote but didn't work
any other suggestion?
shall i write the function code?
thank you very much

Best Regards FireFox-

Last edited by FireFox-; 7th Nov 2005 at 04:41 AM.
FireFox- is offline   Reply With Quote
Old 7th Nov 2005, 04:46 AM   #4
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,785
UnrealScript is an object-oriented language. You will have to know not only what you want to do (i.e. what objects/functions/variables to use), but also where (i.e. which class/object) you want to do it from.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 7th Nov 2005, 04:58 AM   #5
FireFox-
Registered User
 
FireFox-'s Avatar
 
Join Date: Nov. 2nd, 2005
Posts: 16
yes i know that UnrealScript is a object oriented language i noticed it by browsing the source code of ut2k4 and i noticed that everything is linked by class and or class reference in that way it makes the code to be more extended because if i extend a myown class to gameinfo for example
it means that i can use my own variables + the gameinfo's variable am i right?

Last edited by FireFox-; 7th Nov 2005 at 05:04 AM.
FireFox- is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:03 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer