Raised This Month: $ Target: $400
 0% 

problem with random


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EclipseCP
BANNED
Join Date: Dec 2010
Old 04-18-2011 , 12:52   problem with random
Reply With Quote #1

hi, sorry for my bad english, use translator.

I have a problem with random, I make out a random MODEL (there are 2 that could leave), I did this, but I'm warning

PHP Code:
    new _model random_num(01)
    
    switch(
_model)
    {
        case 
0
        {
            
entity_set_model(iEntitytree_model)         
        }
        case 
1
        {
            
entity_set_model(iEntitytree_model2)
        }
    }

    
entity_set_vector(iEntity,EV_VEC_originOrigin)
    
_tree_model
    entity_set_int
(iEntityEV_INT_movetypeMOVETYPE_BOUNCE
grettings.
EclipseCP is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-18-2011 , 12:56   Re: problem with random
Reply With Quote #2

So what that's the problem?
__________________
fysiks is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 04-18-2011 , 13:00   Re: problem with random
Reply With Quote #3

Quote:
Originally Posted by EclipseCP View Post
PHP Code:
    new _model random_num(01)
    
    switch(
_model)
    {
        case 
0
        {
            
entity_set_model(iEntitytree_model)         
        }
        case 
1
        {
            
entity_set_model(iEntitytree_model2)
        }
    }

    
entity_set_vector(iEntity,EV_VEC_originOrigin)
    
_tree_model
    entity_set_int
(iEntityEV_INT_movetypeMOVETYPE_BOUNCE
you can only switch a constant number
use if and else instead
PHP Code:
    new _model random_num(01)
    
    if (!
_model)
            
entity_set_model(iEntitytree_model)         
    else
            
entity_set_model(iEntitytree_model2)

    
entity_set_vector(iEntity,EV_VEC_originOrigin)
    
_tree_model
    entity_set_int
(iEntityEV_INT_movetypeMOVETYPE_BOUNCE
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-18-2011 , 13:02   Re: problem with random
Reply With Quote #4

Quote:
Originally Posted by georgik57 View Post
you can only switch a constant number
use if and else instead
PHP Code:
    new _model random_num(01)
    
    if (!
_model)
            
entity_set_model(iEntitytree_model)         
    else
            
entity_set_model(iEntitytree_model2)

    
entity_set_vector(iEntity,EV_VEC_originOrigin)
    
_tree_model
    entity_set_int
(iEntityEV_INT_movetypeMOVETYPE_BOUNCE
No. You can use a switch with any integer variable.
__________________
fysiks is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 04-18-2011 , 13:03   Re: problem with random
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
No. You can use a switch with any integer variable.
then why it gives him a error?
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-18-2011 , 13:04   Re: problem with random
Reply With Quote #6

Quote:
Originally Posted by georgik57 View Post
then why it gives him a error?
I don't see anywhere that he said it gives him errors.
__________________
fysiks is offline
Old 04-18-2011, 13:05
EclipseCP
This message has been deleted by EclipseCP.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-18-2011 , 13:07   Re: problem with random
Reply With Quote #7

Quote:
Originally Posted by EclipseCP View Post
sorry, warning is:

PHP Code:
WarningExpression has no effect 
in line "_box_model"
The code you posted does not contain "_box_model".
__________________
fysiks is offline
EclipseCP
BANNED
Join Date: Dec 2010
Old 04-18-2011 , 13:08   Re: problem with random
Reply With Quote #8

_tree_model sry -.-
EclipseCP is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-18-2011 , 13:08   Re: problem with random
Reply With Quote #9

Quote:
Originally Posted by EclipseCP View Post
_tree_model sry -.-
Ok, so what is it?
__________________
fysiks is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 04-18-2011 , 13:10   Re: problem with random
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
I don't see anywhere that he said it gives him errors.
Quote:
Originally Posted by EclipseCP View Post
I did this, but I'm warning
an yes, your theory is correct
anyway he is switching a constant number(0 or 1)
eclipse can you show us a screen shot of your error?
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
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 -4. The time now is 20:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode